Add new tests for rbac on some of the org pages

This commit is contained in:
mabashian
2019-04-24 10:09:17 -04:00
parent 82db7df6b3
commit e5dda696d7
4 changed files with 78 additions and 11 deletions

View File

@@ -10,4 +10,14 @@ describe('<OrganizationView />', () => {
test('initially renders succesfully', () => {
mountWithContexts(<Organization me={me} />);
});
test('notifications tab shown/hidden based on permissions', () => {
const wrapper = mountWithContexts(<Organization me={me} />);
expect(wrapper.find('.pf-c-tabs__item').length).toBe(3);
expect(wrapper.find('.pf-c-tabs__button[children="Notifications"]').length).toBe(0);
wrapper.find('Organization').setState({
isNotifAdmin: true
});
expect(wrapper.find('.pf-c-tabs__item').length).toBe(4);
expect(wrapper.find('.pf-c-tabs__button[children="Notifications"]').length).toBe(1);
});
});