diff --git a/e2e-tests/cypress/tests/integration/channels/files_and_attachments/disabled_file_upload_spec.js b/e2e-tests/cypress/tests/integration/channels/files_and_attachments/disabled_file_upload_spec.js index 77574bc69a..917b84ac50 100644 --- a/e2e-tests/cypress/tests/integration/channels/files_and_attachments/disabled_file_upload_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/files_and_attachments/disabled_file_upload_spec.js @@ -140,6 +140,7 @@ describe('Upload Files - Settings', () => { }, }], types: [], + getData: () => {}, }}); // * An error should be visible saying 'File attachments are disabled' @@ -165,6 +166,7 @@ describe('Upload Files - Settings', () => { }, }], types: [], + getData: () => {}, }}); // * An error should be visible saying 'File attachments are disabled' diff --git a/e2e-tests/cypress/tests/integration/channels/files_and_attachments/paste_image_spec.js b/e2e-tests/cypress/tests/integration/channels/files_and_attachments/paste_image_spec.js index bb2596f5de..5fc68aef9f 100644 --- a/e2e-tests/cypress/tests/integration/channels/files_and_attachments/paste_image_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/files_and_attachments/paste_image_spec.js @@ -41,6 +41,7 @@ describe('Paste Image', () => { }, }], types: [], + getData: () => {}, }}); cy.uiWaitForFileUploadPreview(); diff --git a/webapp/channels/src/components/file_upload/file_upload.test.tsx b/webapp/channels/src/components/file_upload/file_upload.test.tsx index e7b75a6b91..a08d58d6ef 100644 --- a/webapp/channels/src/components/file_upload/file_upload.test.tsx +++ b/webapp/channels/src/components/file_upload/file_upload.test.tsx @@ -206,7 +206,7 @@ describe('components/FileUpload', () => { event.preventDefault = jest.fn(); const getAsFile = jest.fn().mockReturnValue(new File(['test'], 'test.png')); const file = {getAsFile, kind: 'file', name: 'test.png'}; - (event as any).clipboardData = {items: [file], types: ['image/png']}; + (event as any).clipboardData = {items: [file], types: ['image/png'], getData: () => {}}; const wrapper = shallowWithIntl( { const event = new Event('paste'); event.preventDefault = jest.fn(); const getAsString = jest.fn(); - (event as any).clipboardData = {items: [{getAsString, kind: 'string', type: 'text/plain'}], types: ['text/plain']}; + (event as any).clipboardData = {items: [{getAsString, kind: 'string', type: 'text/plain'}], types: ['text/plain'], getData: () => {}}; const wrapper = shallowWithIntl( { pasteUpload = (e: ClipboardEvent) => { const {formatMessage} = this.props.intl; - if (!e.clipboardData || !e.clipboardData.items || getHtmlTable(e.clipboardData)) { + if (!e.clipboardData || !e.clipboardData.items || e.clipboardData.getData('text/html')) { return; }