mirror of
https://github.com/ansible/awx.git
synced 2026-01-12 18:40:01 -03:30
fix openDeleteModal with button test
This commit is contained in:
parent
f3a07753e6
commit
cc0fd6beb6
@ -225,10 +225,12 @@ describe('<DataListToolbar />', () => {
|
||||
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 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>
|
||||
@ -241,12 +243,14 @@ describe('<DataListToolbar />', () => {
|
||||
onSearch={onSearch}
|
||||
onSort={onSort}
|
||||
onSelectAll={onSelectAll}
|
||||
onOpenDeleteModal={() => {}}
|
||||
onOpenDeleteModal={onOpenDeleteModal}
|
||||
showDelete={showDelete}
|
||||
disableTrashCanIcon={disableTrashCanIcon}
|
||||
/>
|
||||
</I18nProvider>
|
||||
);
|
||||
|
||||
toolbar.find(deleteModal).simulate('click');
|
||||
toolbar.find(openDeleteModalButton).simulate('click');
|
||||
expect(onOpenDeleteModal).toBeCalled();
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user