Skip to content

Commit

Permalink
Updated unit tests in Jest Test Suite #11 that target EuiButton to si…
Browse files Browse the repository at this point in the history
…mulate click events to target a generic button to prevent undefined click event errors
  • Loading branch information
breehall committed Sep 28, 2022
1 parent e084371 commit 3d9236f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion x-pack/plugins/graph/public/components/search_bar.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ describe('search_bar', () => {

// pick the button component out of the tree because
// it's part of a popover and thus not covered by enzyme
instance.find('[data-test-subj="graphDatasourceButton"]').first().simulate('click');
instance.find('button[data-test-subj="graphDatasourceButton"]').first().simulate('click');

expect(openSourceModal).toHaveBeenCalled();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ describe('settings', () => {
});

it('should delete all nodes', () => {
instance.find('[data-test-subj="graphUnblocklistAll"]').find(EuiButton).simulate('click');
instance.find('button[data-test-subj="graphUnblocklistAll"]').simulate('click');

expect(workspaceProps.unblockAll).toHaveBeenCalled();
});
Expand Down Expand Up @@ -314,7 +314,7 @@ describe('settings', () => {

it('should add url template', async () => {
act(() => {
instance.find('EuiButton[data-test-subj="graphAddNewTemplate"]').simulate('click');
instance.find('button[data-test-subj="graphAddNewTemplate"]').simulate('click');
});
instance.update();

Expand Down

0 comments on commit 3d9236f

Please sign in to comment.