otovo / react-losen

A super customisable Wizard for React and React Native. Docs 👉

Home Page:https://docs-geycgwirqi.now.sh/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Buggy test

lingsuann02 opened this issue · comments

Wizard.test.js - Wizard caches step state in url - renders previous step on back button
Returns false positive.

test('renders previous step on back button', () => {
    window.history.pushState({ activeStep: 'three' }, '', '?step=three');
    // component does not update at this point therefore the expect is always true
    window.history.back();
    expect(component.find('#active-step').text()).toBe('Step two');
});

^^ Comment in code identifies the line of code that is generating the false positive.