Skip to content

Commit

Permalink
[BURGER] beforeEach(), wrapper.setProps()
Browse files Browse the repository at this point in the history
  • Loading branch information
lesiak committed Oct 26, 2020
1 parent ca62858 commit 06c8975
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,18 @@ import NavigationItem from './NavigationItem/NavigationItem';
configure({ adapter: new Adapter() });

describe('<NavigationItems />', () => {
let wrapper;

beforeEach(() => {
wrapper = shallow(<NavigationItems />);
});

it('should render two <NavigationItem /> elements if not authenticated', () => {
const wrapper = shallow(<NavigationItems />);
expect(wrapper.find(NavigationItem)).toHaveLength(2);
});

it('should render three <NavigationItem /> elements if authenticated', () => {
wrapper.setProps({ isUserAuthenticated: true });
expect(wrapper.find(NavigationItem)).toHaveLength(3);
});
});

0 comments on commit 06c8975

Please sign in to comment.