fix: Support the Clipboard API in modern browsers (#20058)

* fix: Support the Clipboard API in modern browsers

* fix tests

* PR comment

* Improvements
This commit is contained in:
Diego Medina
2022-06-03 07:34:00 -04:00
committed by GitHub
parent 92057858c2
commit 0e38c686c6
11 changed files with 118 additions and 57 deletions

View File

@@ -175,9 +175,9 @@ describe('DataTablesPane', () => {
expect(await screen.findByText('1 row')).toBeVisible();
userEvent.click(screen.getByLabelText('Copy'));
expect(copyToClipboardSpy).toHaveBeenCalledWith(
'2009-01-01 00:00:00\tAction\n',
);
expect(copyToClipboardSpy).toHaveBeenCalledTimes(1);
const value = await copyToClipboardSpy.mock.calls[0][0]();
expect(value).toBe('2009-01-01 00:00:00\tAction\n');
copyToClipboardSpy.mockRestore();
fetchMock.restore();
});