score:0

it('should redirect user to pathname=/delegation if pathname=/play', () => {
    const spyBrowserHistory = spy();
    mobileDelegationRewireAPI.__Rewire__('browserHistory', {
        push: spyBrowserHistory
    });
    const wrapper = shallow(<MobileDelegation {...location} />);
    wrapper.instance().componentDidMount();
    expect(spyBrowserHistory.calledOnce).to.be.true;
    expect(spyBrowserHistory.calledWith(`/delegation${location.search}`)).to.be.true;
});

score:9

"jest": {
 ....
    "testURL": "http://test.com/login"
 ....
 }

score:14

window.history.pushState({}, 'Page Title', '/any/url/you/like?with=params&enjoy=true');

Related Articles