explorer/Explorer: work around breaking changes in @testing-library/user-event

@testing-library/user-event "fixed" some hover bugs which broke our
usage, so we need to work around it.
This commit is contained in:
David Lechner
2022-08-03 13:03:18 -05:00
committed by David Lechner
parent c3602d60ab
commit 3ce644d2b3
+8 -4
View File
@@ -106,7 +106,8 @@ describe('tree item', () => {
explorer.getByRole('button', { name: 'Duplicate test.file' }),
);
await user.click(button);
// user.click() has bad interaction with hover so we use user.pointer() instead
await user.pointer({ keys: '[MouseLeft]', target: button });
expect(dispatch).toHaveBeenCalledWith(explorerDuplicateFile('test.file'));
@@ -139,7 +140,8 @@ describe('tree item', () => {
explorer.getByRole('button', { name: 'Rename test.file' }),
);
await user.click(button);
// user.click() has bad interaction with hover so we use user.pointer() instead
await user.pointer({ keys: '[MouseLeft]', target: button });
expect(dispatch).toHaveBeenCalledWith(explorerRenameFile('test.file'));
@@ -172,7 +174,8 @@ describe('tree item', () => {
explorer.getByRole('button', { name: 'Export test.file' }),
);
await user.click(button);
// user.click() has bad interaction with hover so we use user.pointer() instead
await user.pointer({ keys: '[MouseLeft]', target: button });
expect(dispatch).toHaveBeenCalledWith(explorerExportFile('test.file'));
@@ -205,7 +208,8 @@ describe('tree item', () => {
explorer.getByRole('button', { name: 'Delete test.file' }),
);
await user.click(button);
// user.click() has bad interaction with hover so we use user.pointer() instead
await user.pointer({ keys: '[MouseLeft]', target: button });
expect(dispatch).toHaveBeenCalledWith(
explorerDeleteFile('test.file', uuid(0)),