Add alert for org. delete.

This commit is contained in:
Alex Corey
2019-03-25 11:30:40 -04:00
parent 1cb2a95a47
commit f3a07753e6
7 changed files with 209 additions and 60 deletions

View File

@@ -221,4 +221,32 @@ describe('<DataListToolbar />', () => {
const upAlphaIcon = toolbar.find(upAlphaIconSelector);
expect(upAlphaIcon.length).toBe(1);
});
test('trash can button triggers correct function', () => {
const columns = [{ name: 'Name', key: 'name', isSortable: true }];
const onOpenDeleteModal = jest.fn();
const deleteModal = 'button.pf-c-button.pf-m-plain.awx-ToolBarBtn';
const onSearch = jest.fn();
const onSort = jest.fn();
const onSelectAll = jest.fn();
toolbar = mount(
<I18nProvider>
<DataListToolbar
isAllSelected={false}
selected={() => ([1, 2, 3, 4])}
sortedColumnKey="name"
sortOrder="ascending"
columns={columns}
onSearch={onSearch}
onSort={onSort}
onSelectAll={onSelectAll}
onOpenDeleteModal={() => {}}
/>
</I18nProvider>
);
toolbar.find(deleteModal).simulate('click');
expect(onOpenDeleteModal).toBeCalled();
});
});