mirror of
https://github.com/ansible/awx.git
synced 2026-02-23 05:55:59 -03:30
Merge pull request #141 from AlexSCorey/48-deleteOrgs
Add alert for org. delete.
This commit is contained in:
@@ -221,4 +221,36 @@ 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 openDeleteModalButton = 'button[aria-label="Delete"]';
|
||||
const onSearch = jest.fn();
|
||||
const onSort = jest.fn();
|
||||
const onSelectAll = jest.fn();
|
||||
const showDelete = true;
|
||||
const disableTrashCanIcon = false;
|
||||
|
||||
toolbar = mount(
|
||||
<I18nProvider>
|
||||
<DataListToolbar
|
||||
isAllSelected={false}
|
||||
selected={() => [1, 2, 3, 4]}
|
||||
sortedColumnKey="name"
|
||||
sortOrder="ascending"
|
||||
columns={columns}
|
||||
onSearch={onSearch}
|
||||
onSort={onSort}
|
||||
onSelectAll={onSelectAll}
|
||||
onOpenDeleteModal={onOpenDeleteModal}
|
||||
showDelete={showDelete}
|
||||
disableTrashCanIcon={disableTrashCanIcon}
|
||||
/>
|
||||
</I18nProvider>
|
||||
);
|
||||
|
||||
toolbar.find(openDeleteModalButton).simulate('click');
|
||||
expect(onOpenDeleteModal).toBeCalled();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user