diff --git a/app/cypress/e2e/0-ndr-core-tests/gp_upload_workflow_step2_individual_patient_document_upload.cy.js b/app/cypress/e2e/0-ndr-core-tests/gp_upload_workflow_step2_individual_patient_document_upload.cy.js index d19da1dc2..5fccdad58 100644 --- a/app/cypress/e2e/0-ndr-core-tests/gp_upload_workflow_step2_individual_patient_document_upload.cy.js +++ b/app/cypress/e2e/0-ndr-core-tests/gp_upload_workflow_step2_individual_patient_document_upload.cy.js @@ -58,29 +58,42 @@ const testStartAgainButton = () => { cy.url().should('eq', baseUrl); }; -const uploadedFilePathNames = [ - 'cypress/fixtures/test_patient_record.pdf', - 'cypress/fixtures/test_patient_record_two.pdf', -]; - -const uploadedImagesPathNames = [ - 'cypress/fixtures/test-images/test_image.jpg', - 'cypress/fixtures/test-images/test_image_two.jpg', - 'cypress/fixtures/test-images/test_image_three.jpg', - 'cypress/fixtures/test-images/test_image_four.jpg', - 'cypress/fixtures/test-images/test_image_five.jpg', - 'cypress/fixtures/test-images/test_image_six.jpg', - 'cypress/fixtures/test-images/test_image_seven.jpg', - 'cypress/fixtures/test-images/test_image_eight.jpg', - 'cypress/fixtures/test-images/test_image_nine.jpg', - 'cypress/fixtures/test-images/test_image_ten.jpg', - 'cypress/fixtures/test-images/test_image_eleven.jpg', -]; +const singleFileUsecaseIndex = 0; +const multiFileUSecaseIndex = 1; + +const uploadedFilePathNames = { + ARF: [ + 'cypress/fixtures/test_patient_record.pdf', + [ + 'cypress/fixtures/test_patient_record.pdf', + 'cypress/fixtures/test_patient_record_two.pdf', + ], + ], + LG: [ + 'cypress/fixtures/lg-files/1of1_Lloyd_George_Record_[Testy Test]_[0123456789]_[01-01-2011].pdf', + [ + 'cypress/fixtures/lg-files/1of2_Lloyd_George_Record_[Testy Test]_[0123456789]_[01-01-2011].pdf', + 'cypress/fixtures/lg-files/2of2_Lloyd_George_Record_[Testy Test]_[0123456789]_[01-01-2011].pdf', + ], + ], +}; + +const uploadedFileNames = { + ARF: ['test_patient_record.pdf', ['test_patient_record.pdf', 'test_patient_record_two.pdf']], + LG: [ + '1of1_Lloyd_George_Record_[Testy Test]_[0123456789]_[01-01-2011].pdf', + [ + '1of2_Lloyd_George_Record_[Testy Test]_[0123456789]_[01-01-2011].pdf', + '2of2_Lloyd_George_Record_[Testy Test]_[0123456789]_[01-01-2011].pdf', + ], + ], +}; beforeEach(() => { cy.visit(baseUrl); navigateToUploadPage(); }); + describe('[ALL] GP Upload Workflow Step 2: Uploads docs and tests it looks OK', () => { it.skip('(Smoke test) On Start now button click, redirect to uploads is successful', () => { cy.url().should('include', 'upload'); @@ -109,8 +122,8 @@ describe('[ALL] GP Upload Workflow Step 2: Uploads docs and tests it looks OK', }); } - selectForm(formTypes.ARF).selectFile(uploadedFilePathNames[0]); - selectForm(formTypes.LG).selectFile(uploadedFilePathNames[1]); + selectForm(formTypes.ARF).selectFile(uploadedFilePathNames.ARF[singleFileUsecaseIndex]); + selectForm(formTypes.LG).selectFile(uploadedFilePathNames.LG[singleFileUsecaseIndex]); clickUploadButton(); @@ -120,10 +133,12 @@ describe('[ALL] GP Upload Workflow Step 2: Uploads docs and tests it looks OK', cy.get('#successful-uploads-dropdown').click(); cy.get('#successful-uploads tbody tr').should('have.length', 2); - cy.get('#successful-uploads tbody tr').eq(0).should('contain', 'test_patient_record.pdf'); + cy.get('#successful-uploads tbody tr') + .eq(0) + .should('contain', uploadedFileNames.ARF[singleFileUsecaseIndex]); cy.get('#successful-uploads tbody tr') .eq(1) - .should('contain', 'test_patient_record_two.pdf'); + .should('contain', uploadedFileNames.LG[singleFileUsecaseIndex]); cy.get('#close-page-warning').should('be.visible'); testStartAgainButton(); @@ -134,14 +149,14 @@ Object.values(formTypes).forEach((type) => { describe(`[${type}] GP Upload Workflow Step 2: Uploads docs and tests it looks OK`, () => { it.skip(`(Smoke test) Single file - On Choose files button click, file selection is visible for ${type} input`, () => { cy.get('#selected-documents-table').should('not.exist'); - selectForm(type).selectFile(uploadedFilePathNames[0]); + selectForm(type).selectFile(uploadedFilePathNames[type][singleFileUsecaseIndex]); cy.get('#selected-documents-table').should('be.visible'); cy.get('#selected-documents-table tbody tr').should('have.length', 1); cy.get('#selected-documents-table tbody tr') .first() .get('td') .first() - .should('have.text', 'test_patient_record.pdf'); + .should('contain.text', uploadedFileNames[type][singleFileUsecaseIndex]); }); it.skip(`Single file - On Upload button click, renders Upload Summary with error box when DocumentReference returns a 500 for ${type} input`, () => { @@ -150,7 +165,7 @@ Object.values(formTypes).forEach((type) => { statusCode: 500, }); - selectForm(type).selectFile(uploadedFilePathNames[0]); + selectForm(type).selectFile(uploadedFilePathNames[type][singleFileUsecaseIndex]); clickUploadButton(); @@ -161,7 +176,7 @@ Object.values(formTypes).forEach((type) => { .first() .get('td') .first() - .should('contain', 'test_patient_record.pdf'); + .should('contain', uploadedFileNames[type][0]); cy.get('#failed-uploads').should('contain', '1 of 1 files failed to upload'); cy.get('#close-page-warning').should('be.visible'); @@ -174,7 +189,7 @@ Object.values(formTypes).forEach((type) => { statusCode: 404, }); - selectForm(type).selectFile(uploadedFilePathNames[1]); + selectForm(type).selectFile(uploadedFilePathNames[type][singleFileUsecaseIndex]); clickUploadButton(); @@ -183,9 +198,9 @@ Object.values(formTypes).forEach((type) => { cy.get('#failed-uploads tbody tr').should('have.length', 1); cy.get('#failed-uploads tbody tr') .first() - .get('td') + .children() .first() - .should('contain', 'test_patient_record_two.pdf'); + .should('contain', uploadedFileNames[type][singleFileUsecaseIndex]); cy.get('#failed-uploads').should('contain', '1 of 1 files failed to upload'); cy.get('#close-page-warning').should('be.visible'); @@ -200,7 +215,7 @@ Object.values(formTypes).forEach((type) => { statusCode: 500, }); - selectForm(type).selectFile(uploadedImagesPathNames[0]); + selectForm(type).selectFile(uploadedFilePathNames[type][singleFileUsecaseIndex]); clickUploadButton(); @@ -209,9 +224,9 @@ Object.values(formTypes).forEach((type) => { cy.get('#failed-uploads tbody tr').should('have.length', 1); cy.get('#failed-uploads tbody tr') .first() - .get('td') + .children() .first() - .should('contain', 'test_image.jpg'); + .should('contain.text', uploadedFileNames[type][singleFileUsecaseIndex]); cy.get('#failed-uploads').should('contain', '1 of 1 files failed to upload'); cy.get('#close-page-warning').should('be.visible'); @@ -220,17 +235,20 @@ Object.values(formTypes).forEach((type) => { it.skip(`(Smoke test) Multiple files - On Choose files button click, file selection is visible for ${type} input`, () => { cy.get('#selected-documents-table').should('not.exist'); - selectForm(type).selectFile(uploadedFilePathNames); + selectForm(type).selectFile(uploadedFilePathNames[type][multiFileUSecaseIndex]); cy.get('#selected-documents-table').should('be.visible'); cy.get('#selected-documents-table tbody tr').should('have.length', 2); + cy.get('#selected-documents-table tbody tr') .first() - .get('td') + .children() .first() - .should('have.text', 'test_patient_record.pdf'); + .should('have.text', uploadedFileNames[type][multiFileUSecaseIndex][0]); cy.get('#selected-documents-table tbody tr') - .next() - .contains('td', 'test_patient_record_two.pdf'); + .eq(1) + .children() + .first() + .should('have.text', uploadedFileNames[type][multiFileUSecaseIndex][1]); }); it.skip(`(Smoke test) Multiple files - On Upload button click, renders Upload Summary for successful upload for ${type} input`, () => { @@ -255,7 +273,7 @@ Object.values(formTypes).forEach((type) => { }); } - selectForm(type).selectFile(uploadedFilePathNames); + selectForm(type).selectFile(uploadedFilePathNames[type][multiFileUSecaseIndex]); clickUploadButton(); @@ -265,9 +283,9 @@ Object.values(formTypes).forEach((type) => { cy.get('#successful-uploads tbody tr').should('have.length', 2); cy.get('#successful-uploads tbody tr') .first() - .get('td') + .children() .first() - .should('contain', 'test_patient_record.pdf'); + .should('contain', uploadedFileNames[type][multiFileUSecaseIndex][0]); cy.get('#close-page-warning').should('be.visible'); testStartAgainButton(); @@ -277,30 +295,24 @@ Object.values(formTypes).forEach((type) => { cy.intercept('POST', '**/DocumentReference*', (req) => { req.reply({ statusCode: 200, + delay: 1500, body: { url: bucketUrlIdentifer, fields: { - key: '382d3db4-9625-4bd9-ad46-c2e31451efd2', + key: 'xxxxxxxxxxxx2', 'x-amz-algorithm': 'AWS4-HMAC-SHA256', 'x-amz-credential': - 'ASIAXYSUA44VYD2FFBHK/20230904/eu-west-2/s3/aws4_request', + 'xxxxxxxxxxxxxxxxxx/20230904/eu-west-2/s3/aws4_request', 'x-amz-date': '20230904T125954Z', - 'x-amz-security-token': - 'IQoJb3JpZ2luX2VjEG0aCWV1LXdlc3QtMiJHMEUCIQC1Mx4VTrF2alA9s8P5HJ+j9y2XJmAF5ODdZGEui/QMGwIgRdGiuXVqq8Uq6l5dJZpAx39b1kro7x1Q0FQn6rWRUvUqggMIRhABGgw1MzM4MjU5MDY0NzUiDOeBIQxpj1BmAtTeVSrfAsugZpo7cQzj+R0uwE9o3bxMyR7lqdVCkaAb/ZVF4iBY/Cn7FYCB+pO3nvS6CWLClcIbNhhZkqgJOZvBJ+fua5QvchxX4LO+sq0Or+s29Ym8mSNHpB4mLi3iyQZ08Iw1p9c52Mfo6B5mh5IGKu8gvKf1y9gOWKAJTTuLbuzKKkbII4tRr+1PSAeFwLgSSzeDInv9QnTbKAPSbVMAWBic07MTlQpeMD3SNiXqKz+f/HNiujCOxfvUO0Yvw5GXx0FBrGjaHY979YGJuuC35yMqnFG0tvdd/8OfdUhHDM6XqRMGmceMkdMldQsw4VwhSd+uI4qIrHopMNQ+XKdqDjrkmlRprATIT9boO1fQ1GFO2l1YVVM2WzORIwVd2hGQr6anfXyOePk8N8MYNuzwZdgOiEKPwS2b6vByMBr/U7jNUuUZNd9rhbZIv5dsMF2xszXq8co3ZngvPjWKYsdZF6eGUDDHqdenBjqeAYZZ0oBZqtgVF3ebT86UWZ40zS0vGZSzSt5P5DhlTP01LRPeQCARoETZ/IsUzvrP5QLwmkOjSoJlYIu/U1SeqvVZblnPHsHVi/0QI4FuZhPL9LnA628+euBTaO6I2DSf1ugPmwMc/YMYwHQdkSKNsejAPczYSxAyPAWLtiLckMPqo5YyyiRYMHpmZwrqJsdbAVogVhIgfYx53OJIhblI', - policy: 'eyJleHBpcmF0aW9uIjogIjIwMjMtMDktMDRUMTM6Mjk6NTRaIi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URqcmttbFJwckFUSVQ5Ym9PMWZRMUdGTzJsMVlWVk0yV3pPUkl3VmQyaEdRcjZhbmZYeU9lUGs4TjhNWU51endaZGdPaUVLUHdTMmI2dkJ5TUJyL1U3ak5VdVVaTmQ5cmhiWkl2NWRzTUYyeHN6WHE4Y28zWm5ndlBqV0tZc2RaRjZlR1VEREhxZGVuQmpxZUFZWlowb0JacXRnVkYzZWJUODZVV1o0MHpTMHZHWlN6U3Q1UDVEaGxUUDAxTFJQZVFDQVJvRVRaL0lzVXp2clA1UUx3bWtPalNvSmxZSXUvVTFTZXF2VlpibG5QSHNIVmkvMFFJNEZ1WmhQTDlMbkE2MjgrZXVCVGFPNkkyRFNmMXVnUG13TWMvWU1Zd0hRZGtTS05zZWpBUGN6WVN4QXlQQVdMdGlMY2tNUHFvNVl5eWlSWU1IcG1ad3JxSnNkYkFWb2dWaElnZll4NTNPSkloYmxJIn1dfQ==', - 'x-amz-signature': - '9e861ee405f4930c8fd992e631fa202563b50b23c2f505cbfcbd407198cd594d', + 'x-amz-security-token': 'xxxxxxxxxxxxxxxx', + policy: 'xxxxxxxxx====', + 'x-amz-signature': 'xxxxxxxxx', }, }, }); - req.on('response', (res) => { - // Throttle the response to 1 Mbps to simulate a - // mobile 3G connection - res.setThrottle(1000); - }); }); - selectForm(type).selectFile(uploadedImagesPathNames); + selectForm(type).selectFile(uploadedFilePathNames[type][multiFileUSecaseIndex]); clickUploadButton(); @@ -313,19 +325,29 @@ Object.values(formTypes).forEach((type) => { statusCode: 500, }); - selectForm(type).selectFile(uploadedImagesPathNames); + selectForm(type).selectFile(uploadedFilePathNames[type][1]); clickUploadButton(); cy.get('#failed-document-uploads-summary-title').should('be.visible'); cy.get('#failed-uploads').should('be.visible'); - cy.get('#failed-uploads tbody tr').should('have.length', 11); + cy.get('#failed-uploads tbody tr').should( + 'have.length', + uploadedFilePathNames[type][1].length, + ); + cy.get('#failed-uploads tbody tr') .first() - .get('td') + .children() .first() - .should('contain', 'test_image.jpg'); - cy.get('#failed-uploads').should('contain', '11 of 11 files failed to upload'); + .should('contain.text', uploadedFileNames[type][multiFileUSecaseIndex][0]); + + const fileCount = uploadedFilePathNames[type][multiFileUSecaseIndex].length; + cy.get('#failed-uploads').should( + 'contain', + fileCount + ' of ' + fileCount + ' files failed to upload', + ); + cy.get('#close-page-warning').should('be.visible'); testStartAgainButton(); @@ -337,19 +359,29 @@ Object.values(formTypes).forEach((type) => { statusCode: 404, }); - selectForm(type).selectFile(uploadedImagesPathNames); + selectForm(type).selectFile(uploadedFilePathNames[type][multiFileUSecaseIndex]); clickUploadButton(); cy.get('#failed-document-uploads-summary-title').should('be.visible'); cy.get('#failed-uploads').should('be.visible'); - cy.get('#failed-uploads tbody tr').should('have.length', 11); + cy.get('#failed-uploads tbody tr').should( + 'have.length', + uploadedFilePathNames[type][multiFileUSecaseIndex].length, + ); + cy.get('#failed-uploads tbody tr') .first() - .get('td') + .children() .first() - .should('contain', 'test_image.jpg'); - cy.get('#failed-uploads').should('contain', '11 of 11 files failed to upload'); + .should('contain.text', uploadedFileNames[type][multiFileUSecaseIndex][0]); + + const fileCount = uploadedFilePathNames[type][multiFileUSecaseIndex].length; + cy.get('#failed-uploads').should( + 'contain', + fileCount + ' of ' + fileCount + ' files failed to upload', + ); + cy.get('#close-page-warning').should('be.visible'); testStartAgainButton(); @@ -361,16 +393,13 @@ Object.values(formTypes).forEach((type) => { body: { url: bucketUrlIdentifer, fields: { - key: '382d3db4-9625-4bd9-ad46-c2e31451efd2', + key: 'xxxxxxxxxxxx2', 'x-amz-algorithm': 'AWS4-HMAC-SHA256', - 'x-amz-credential': - 'ASIAXYSUA44VYD2FFBHK/20230904/eu-west-2/s3/aws4_request', + 'x-amz-credential': 'xxxxxxxxxxxxxxxxxx/20230904/eu-west-2/s3/aws4_request', 'x-amz-date': '20230904T125954Z', - 'x-amz-security-token': - 'IQoJb3JpZ2luX2VjEG0aCWV1LXdlc3QtMiJHMEUCIQC1Mx4VTrF2alA9s8P5HJ+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lowb0JacXRnVkYzZWJUODZVV1o0MHpTMHZHWlN6U3Q1UDVEaGxUUDAxTFJQZVFDQVJvRVRaL0lzVXp2clA1UUx3bWtPalNvSmxZSXUvVTFTZXF2VlpibG5QSHNIVmkvMFFJNEZ1WmhQTDlMbkE2MjgrZXVCVGFPNkkyRFNmMXVnUG13TWMvWU1Zd0hRZGtTS05zZWpBUGN6WVN4QXlQQVdMdGlMY2tNUHFvNVl5eWlSWU1IcG1ad3JxSnNkYkFWb2dWaElnZll4NTNPSkloYmxJIn1dfQ==', - 'x-amz-signature': - '9e861ee405f4930c8fd992e631fa202563b50b23c2f505cbfcbd407198cd594d', + 'x-amz-security-token': 'xxxxxxxxxxxxxxxx', + policy: 'xxxxxxxxx====', + 'x-amz-signature': 'xxxxxxxxx', }, }, }); @@ -383,14 +412,14 @@ Object.values(formTypes).forEach((type) => { }); }); - selectForm(type).selectFile(uploadedImagesPathNames); + selectForm(type).selectFile(uploadedFilePathNames[type][multiFileUSecaseIndex]); clickUploadButton(); cy.get('#upload-summary-header').should('be.visible'); - cy.get('#failed-uploads').should('contain', '6 of 11 files failed to upload'); - cy.get('#failed-uploads tbody tr').should('have.length', 6); - cy.get('#successful-uploads tbody tr').should('have.length', 5); + cy.get('#failed-uploads').should('contain', '1 of 2 files failed to upload'); + cy.get('#failed-uploads tbody tr').should('have.length', 1); + cy.get('#successful-uploads tbody tr').should('have.length', 1); cy.get('#close-page-warning').should('be.visible'); testStartAgainButton(); diff --git a/app/cypress/fixtures/lg-files/1of1_Lloyd_George_Record_[Testy Test]_[0123456789]_[01-01-2011].pdf b/app/cypress/fixtures/lg-files/1of1_Lloyd_George_Record_[Testy Test]_[0123456789]_[01-01-2011].pdf new file mode 100644 index 000000000..e69de29bb diff --git a/app/cypress/fixtures/lg-files/1of2_Lloyd_George_Record_[Testy Test]_[0123456789]_[01-01-2011].pdf b/app/cypress/fixtures/lg-files/1of2_Lloyd_George_Record_[Testy Test]_[0123456789]_[01-01-2011].pdf new file mode 100644 index 000000000..e69de29bb diff --git a/app/cypress/fixtures/lg-files/2of2_Lloyd_George_Record_[Testy Test]_[0123456789]_[01-01-2011].pdf b/app/cypress/fixtures/lg-files/2of2_Lloyd_George_Record_[Testy Test]_[0123456789]_[01-01-2011].pdf new file mode 100644 index 000000000..e69de29bb diff --git a/app/cypress/fixtures/test-images/test_image.jpg b/app/cypress/fixtures/test-images/test_image.jpg deleted file mode 100644 index 152d9abee..000000000 Binary files a/app/cypress/fixtures/test-images/test_image.jpg and /dev/null differ diff --git a/app/cypress/fixtures/test-images/test_image_eight.jpg b/app/cypress/fixtures/test-images/test_image_eight.jpg deleted file mode 100644 index bfb6cc835..000000000 Binary files a/app/cypress/fixtures/test-images/test_image_eight.jpg and /dev/null differ diff --git a/app/cypress/fixtures/test-images/test_image_eleven.jpg b/app/cypress/fixtures/test-images/test_image_eleven.jpg deleted file mode 100644 index 70c22b425..000000000 Binary files a/app/cypress/fixtures/test-images/test_image_eleven.jpg and /dev/null differ diff --git a/app/cypress/fixtures/test-images/test_image_five.jpg b/app/cypress/fixtures/test-images/test_image_five.jpg deleted file mode 100644 index 032021bd3..000000000 Binary files a/app/cypress/fixtures/test-images/test_image_five.jpg and /dev/null differ diff --git a/app/cypress/fixtures/test-images/test_image_four.jpg b/app/cypress/fixtures/test-images/test_image_four.jpg deleted file mode 100644 index e08bf57ad..000000000 Binary files a/app/cypress/fixtures/test-images/test_image_four.jpg and /dev/null differ diff --git a/app/cypress/fixtures/test-images/test_image_nine.jpg b/app/cypress/fixtures/test-images/test_image_nine.jpg deleted file mode 100644 index fd4973a24..000000000 Binary files a/app/cypress/fixtures/test-images/test_image_nine.jpg and /dev/null differ diff --git a/app/cypress/fixtures/test-images/test_image_seven.jpg b/app/cypress/fixtures/test-images/test_image_seven.jpg deleted file mode 100644 index cec209c65..000000000 Binary files a/app/cypress/fixtures/test-images/test_image_seven.jpg and /dev/null differ diff --git a/app/cypress/fixtures/test-images/test_image_six.jpg b/app/cypress/fixtures/test-images/test_image_six.jpg deleted file mode 100644 index 374f2a94c..000000000 Binary files a/app/cypress/fixtures/test-images/test_image_six.jpg and /dev/null differ diff --git a/app/cypress/fixtures/test-images/test_image_ten.jpg b/app/cypress/fixtures/test-images/test_image_ten.jpg deleted file mode 100644 index 7f6c8bf5a..000000000 Binary files a/app/cypress/fixtures/test-images/test_image_ten.jpg and /dev/null differ diff --git a/app/cypress/fixtures/test-images/test_image_three.jpg b/app/cypress/fixtures/test-images/test_image_three.jpg deleted file mode 100644 index a878ae5f3..000000000 Binary files a/app/cypress/fixtures/test-images/test_image_three.jpg and /dev/null differ diff --git a/app/cypress/fixtures/test-images/test_image_two.jpg b/app/cypress/fixtures/test-images/test_image_two.jpg deleted file mode 100644 index fd4973a24..000000000 Binary files a/app/cypress/fixtures/test-images/test_image_two.jpg and /dev/null differ diff --git a/app/src/components/blocks/documentInputForm/DocumentInputForm.tsx b/app/src/components/blocks/documentInputForm/DocumentInputForm.tsx index 348044def..25d381759 100644 --- a/app/src/components/blocks/documentInputForm/DocumentInputForm.tsx +++ b/app/src/components/blocks/documentInputForm/DocumentInputForm.tsx @@ -75,12 +75,23 @@ const DocumentInputForm = ({ . )} + {formType === DOCUMENT_TYPE.LLOYD_GEORGE && ( + <> +
There are two or more documents with the same name.
diff --git a/app/src/components/blocks/selectStage/SelectStage.test.tsx b/app/src/components/blocks/selectStage/SelectStage.test.tsx index b59bde1b5..9c06681a6 100644 --- a/app/src/components/blocks/selectStage/SelectStage.test.tsx +++ b/app/src/components/blocks/selectStage/SelectStage.test.tsx @@ -1,7 +1,11 @@ /* eslint-disable testing-library/no-unnecessary-act */ import { render, screen, waitFor } from '@testing-library/react'; import SelectStage from './SelectStage'; -import { buildPatientDetails, buildTextFile } from '../../../helpers/test/testBuilders'; +import { + buildPatientDetails, + buildTextFile, + buildLgFile, +} from '../../../helpers/test/testBuilders'; import userEvent from '@testing-library/user-event'; import { DOCUMENT_UPLOAD_STATE as documentUploadStates } from '../../../types/pages/UploadDocumentsPage/types'; import { act } from 'react-dom/test-utils'; @@ -19,6 +23,9 @@ describe('