Skip to content

Commit

Permalink
fix: fixed tests, removed now obsolete test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
partisaani committed Dec 4, 2024
1 parent 190395a commit b205af9
Showing 1 changed file with 2 additions and 49 deletions.
51 changes: 2 additions & 49 deletions test/unit/views/ItineraryPage/component/NavigatorIntro.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ describe('<NavigatorIntro />', () => {
},
);

expect(
wrapper.find('div.navigator-intro-modal-content img'),
).to.have.lengthOf(1);
expect(wrapper.find('div.intro-body img')).to.have.lengthOf(1);
});

it('should not render logo if prop is missing', () => {
Expand All @@ -38,51 +36,6 @@ describe('<NavigatorIntro />', () => {
childContextTypes: { ...mockChildContextTypes },
});

assert(wrapper.find('div.navigator-intro-modal-content img'), undefined);
});

it('should render login tip if login is allowed and user is not logged in', () => {
const wrapper = mountWithIntl(
<NavigatorIntro {...defaultProps} isLoggedIn={false} />,
{
context: {
...mockContext,
config: { CONFIG: 'default', allowLogin: true },
},
childContextTypes: { ...mockChildContextTypes },
},
);

expect(wrapper.find('div.login-tip')).to.have.lengthOf(1);
});

it('should not render login tip if login is not allowed and user is not logged in', () => {
const wrapper = mountWithIntl(
<NavigatorIntro {...defaultProps} isLoggedIn={false} />,
{
context: {
...mockContext,
config: { CONFIG: 'default', allowLogin: true },
},
childContextTypes: { ...mockChildContextTypes },
},
);

assert(wrapper.find('div.login-tip'), undefined);
});

it('should not render login tip if login is allowed and user logged in', () => {
const wrapper = mountWithIntl(
<NavigatorIntro {...defaultProps} isLoggedIn />,
{
context: {
...mockContext,
config: { CONFIG: 'default', allowLogin: true },
},
childContextTypes: { ...mockChildContextTypes },
},
);

assert(wrapper.find('div.login-tip'), undefined);
assert(wrapper.find('div.intro-body img'), undefined);
});
});

0 comments on commit b205af9

Please sign in to comment.