diff --git a/__tests__/components/AddResourceRole.test.jsx b/__tests__/components/AddResourceRole.test.jsx index f439a320d3..edd8dcf1c2 100644 --- a/__tests__/components/AddResourceRole.test.jsx +++ b/__tests__/components/AddResourceRole.test.jsx @@ -3,7 +3,7 @@ import { shallow } from 'enzyme'; import { mountWithContexts } from '../enzymeHelpers'; import AddResourceRole from '../../src/components/AddRole/AddResourceRole'; -describe('', () => { +describe('', () => { const readUsers = jest.fn().mockResolvedValue({ data: { count: 2, @@ -147,6 +147,7 @@ describe('', () => { foo: 'bar' }); }); + test('handleResourceSelect clears out selected lists and sets selectedResource', () => { const wrapper = shallow( ', () => { expect(wrapper.state()).toEqual({ selectedResource: 'users', selectedResourceRows: [], - selectedRoleRows: [] + selectedRoleRows: [], + currentStepId: 1, }); wrapper.instance().handleResourceSelect('teams'); expect(wrapper.state()).toEqual({ selectedResource: 'teams', selectedResourceRows: [], - selectedRoleRows: [] + selectedRoleRows: [], + currentStepId: 1 }); }); + test('handleWizardSave makes correct api calls, calls onSave when done', async () => { const handleSave = jest.fn(); const wrapper = mountWithContexts( diff --git a/__tests__/components/RoutedTabs.test.jsx b/__tests__/components/RoutedTabs.test.jsx index 9fcd896ef9..58c92ffa98 100644 --- a/__tests__/components/RoutedTabs.test.jsx +++ b/__tests__/components/RoutedTabs.test.jsx @@ -2,6 +2,7 @@ import React from 'react'; import { mount, shallow } from 'enzyme'; import { Router } from 'react-router-dom'; import { createMemoryHistory } from 'history'; +import { Tab } from '@patternfly/react-core'; import RoutedTabs, { _RoutedTabs } from '../../src/components/Tabs/RoutedTabs'; let wrapper; @@ -28,7 +29,7 @@ describe('', () => { history={history} /> ); - expect(wrapper.find('Tab')).toHaveLength(4); + expect(wrapper.find(Tab)).toHaveLength(4); }); test('Given a URL the correct tab is active', async () => { diff --git a/__tests__/components/__snapshots__/NotificationListItem.test.jsx.snap b/__tests__/components/__snapshots__/NotificationListItem.test.jsx.snap index 03c9844573..47bf1aee3d 100644 --- a/__tests__/components/__snapshots__/NotificationListItem.test.jsx.snap +++ b/__tests__/components/__snapshots__/NotificationListItem.test.jsx.snap @@ -80,10 +80,16 @@ exports[` initially renders succe , initially renders succe
initially renders succesfully 1`] = ` } } renderItem={[Function]} + toolbarColumns={ + Array [ + Object { + "isSortable": true, + "key": "name", + "name": "Name", + }, + Object { + "isNumeric": true, + "isSortable": true, + "key": "modified", + "name": "Modified", + }, + Object { + "isNumeric": true, + "isSortable": true, + "key": "created", + "name": "Created", + }, + ] + } > initially renders succesfully 1`] = ` "key": "name", "name": "Name", }, + Object { + "isNumeric": true, + "isSortable": true, + "key": "modified", + "name": "Modified", + }, + Object { + "isNumeric": true, + "isSortable": true, + "key": "created", + "name": "Created", + }, ] } > @@ -157,6 +190,18 @@ exports[` initially renders succesfully 1`] = ` "key": "name", "name": "Name", }, + Object { + "isNumeric": true, + "isSortable": true, + "key": "modified", + "name": "Modified", + }, + Object { + "isNumeric": true, + "isSortable": true, + "key": "created", + "name": "Created", + }, ] } deleteTooltip="Delete" @@ -262,6 +307,18 @@ exports[` initially renders succesfully 1`] = ` "key": "name", "name": "Name", }, + Object { + "isNumeric": true, + "isSortable": true, + "key": "modified", + "name": "Modified", + }, + Object { + "isNumeric": true, + "isSortable": true, + "key": "created", + "name": "Created", + }, ] } onSearch={[Function]} @@ -277,7 +334,28 @@ exports[` initially renders succesfully 1`] = ` + Modified + , + + Created + , + ] + } isOpen={false} isPlain={false} onSelect={[Function]} @@ -305,10 +383,10 @@ exports[` initially renders succesfully 1`] = ` onToggle={[Function]} > initially renders succesfully 1`] = ` > +
+ } + > + + + + } + > + + + + +