mirror of
https://github.com/ansible/awx.git
synced 2026-02-01 01:28:09 -03:30
Add alert for org. delete.
This commit is contained in:
@@ -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();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user