From 0f0db8b547991ff75723688439a887de494efe0f Mon Sep 17 00:00:00 2001 From: pearl-truss Date: Thu, 31 Aug 2023 15:10:45 -0400 Subject: [PATCH 01/17] make copy changes for the Rates Detail page --- .../SingleRateCert/SingleRateCert.tsx | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/services/app-web/src/pages/StateSubmission/RateDetails/SingleRateCert/SingleRateCert.tsx b/services/app-web/src/pages/StateSubmission/RateDetails/SingleRateCert/SingleRateCert.tsx index 8f6e5f0ba3..f60f576cef 100644 --- a/services/app-web/src/pages/StateSubmission/RateDetails/SingleRateCert/SingleRateCert.tsx +++ b/services/app-web/src/pages/StateSubmission/RateDetails/SingleRateCert/SingleRateCert.tsx @@ -157,7 +157,7 @@ export const SingleRateCert = ({ - Upload one rate certification only. - - - {supportingDocsByRate - ? 'Additional rates can be added later.' - : 'Additional rates and supporting documents can be added later.'} + {`Upload only one rate certification document. ${ + supportingDocsByRate + ? 'Additional rates can be added later.' + : 'Additional rates and supporting documents can be added later.' + }`} - This input only accepts PDF, CSV, DOC, DOCX, - XLS, XLSX, XLSM files. + This input only accepts one file in PDF, DOC, or + DOCX format. } From 7552eb25366bd219b0481acffae7ad134b221770 Mon Sep 17 00:00:00 2001 From: pearl-truss Date: Thu, 31 Aug 2023 15:50:57 -0400 Subject: [PATCH 02/17] add copy changes for contract detail --- .../ContractDetails/ContractDetails.tsx | 14 +++++++------- .../StateSubmissionForm.module.scss | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/services/app-web/src/pages/StateSubmission/ContractDetails/ContractDetails.tsx b/services/app-web/src/pages/StateSubmission/ContractDetails/ContractDetails.tsx index 5a46450629..da7931d71c 100644 --- a/services/app-web/src/pages/StateSubmission/ContractDetails/ContractDetails.tsx +++ b/services/app-web/src/pages/StateSubmission/ContractDetails/ContractDetails.tsx @@ -530,13 +530,6 @@ export const ContractDetails = ({ - - Upload one contract only. - - - Supporting documents can be - added later. - + + Supporting documents can be + added later. If you have + additional contract actions, you + must submit them in a separate + submission. + This input only accepts PDF, CSV, DOC, DOCX, XLS, XLSX, XLSM diff --git a/services/app-web/src/pages/StateSubmission/StateSubmissionForm.module.scss b/services/app-web/src/pages/StateSubmission/StateSubmissionForm.module.scss index f7682a24bb..2c640b0848 100644 --- a/services/app-web/src/pages/StateSubmission/StateSubmissionForm.module.scss +++ b/services/app-web/src/pages/StateSubmission/StateSubmissionForm.module.scss @@ -136,7 +136,7 @@ } .guidanceTextBlock{ - padding-top: .5em; + padding-top: 0; display: flex; flex-direction: column; } From 65db3315a275316bfeccada751165c5ead73af35 Mon Sep 17 00:00:00 2001 From: pearl-truss Date: Thu, 31 Aug 2023 16:03:57 -0400 Subject: [PATCH 03/17] update copy on supporting documents page, remove XLSXM as a file type in help text --- .../ContractDetails/ContractDetails.tsx | 3 +-- .../src/pages/StateSubmission/Documents/Documents.tsx | 10 +++++++--- .../RateDetails/SingleRateCert/SingleRateCert.tsx | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/services/app-web/src/pages/StateSubmission/ContractDetails/ContractDetails.tsx b/services/app-web/src/pages/StateSubmission/ContractDetails/ContractDetails.tsx index da7931d71c..ff9409e7cc 100644 --- a/services/app-web/src/pages/StateSubmission/ContractDetails/ContractDetails.tsx +++ b/services/app-web/src/pages/StateSubmission/ContractDetails/ContractDetails.tsx @@ -548,8 +548,7 @@ export const ContractDetails = ({ This input only accepts PDF, - CSV, DOC, DOCX, XLS, XLSX, XLSM - files. + CSV, DOC, DOCX, XLS, XLSX files. } diff --git a/services/app-web/src/pages/StateSubmission/Documents/Documents.tsx b/services/app-web/src/pages/StateSubmission/Documents/Documents.tsx index 1c67a97872..d0a8df7504 100644 --- a/services/app-web/src/pages/StateSubmission/Documents/Documents.tsx +++ b/services/app-web/src/pages/StateSubmission/Documents/Documents.tsx @@ -299,7 +299,7 @@ export const Documents = ({ @@ -311,9 +311,13 @@ export const Documents = ({ > Document definitions and requirements - + + Upload any supporting documents related to + the contract. + + This input only accepts PDF, CSV, DOC, DOCX, - XLS, XLSX, XLSM files. + XLS, XLSX files. } diff --git a/services/app-web/src/pages/StateSubmission/RateDetails/SingleRateCert/SingleRateCert.tsx b/services/app-web/src/pages/StateSubmission/RateDetails/SingleRateCert/SingleRateCert.tsx index f60f576cef..f532410af9 100644 --- a/services/app-web/src/pages/StateSubmission/RateDetails/SingleRateCert/SingleRateCert.tsx +++ b/services/app-web/src/pages/StateSubmission/RateDetails/SingleRateCert/SingleRateCert.tsx @@ -171,7 +171,7 @@ export const SingleRateCert = ({ > Document definitions and requirements - + {`Upload only one rate certification document. ${ supportingDocsByRate ? 'Additional rates can be added later.' From 86e2aaa483050b4a9e5949119b464f6404d43f27 Mon Sep 17 00:00:00 2001 From: pearl-truss Date: Thu, 31 Aug 2023 16:55:24 -0400 Subject: [PATCH 04/17] update unit test --- .../ContractDetails/ContractDetails.test.tsx | 4 +- .../Documents/Documents.test.tsx | 42 +++++++-------- .../RateDetails/RateDetails.test.tsx | 54 +++++++++++++------ .../SingleRateCert/SingleRateCert.tsx | 2 +- .../StateSubmissionForm.test.tsx | 4 +- 5 files changed, 64 insertions(+), 42 deletions(-) diff --git a/services/app-web/src/pages/StateSubmission/ContractDetails/ContractDetails.test.tsx b/services/app-web/src/pages/StateSubmission/ContractDetails/ContractDetails.test.tsx index 7f05323439..8e4facd193 100644 --- a/services/app-web/src/pages/StateSubmission/ContractDetails/ContractDetails.test.tsx +++ b/services/app-web/src/pages/StateSubmission/ContractDetails/ContractDetails.test.tsx @@ -71,7 +71,9 @@ describe('ContractDetails', () => { ) // check hint text - await screen.findByText('Supporting documents can be added later.') + await screen.findByText( + 'Supporting documents can be added later. If you have additional contract actions, you must submit them in a separate submission.' + ) await screen.findByRole('link', { name: /Document definitions/ }) // check file input presences diff --git a/services/app-web/src/pages/StateSubmission/Documents/Documents.test.tsx b/services/app-web/src/pages/StateSubmission/Documents/Documents.test.tsx index 77b3fb1ef1..33dcbbbf9e 100644 --- a/services/app-web/src/pages/StateSubmission/Documents/Documents.test.tsx +++ b/services/app-web/src/pages/StateSubmission/Documents/Documents.test.tsx @@ -65,7 +65,7 @@ describe('Documents', () => { ) const input = screen.getByLabelText( - 'Upload any additional supporting documents' + 'Upload contract-supporting documents' ) expect(input).toBeInTheDocument() await userEvent.upload(input, [TEST_DOC_FILE]) @@ -89,7 +89,7 @@ describe('Documents', () => { ) const input = screen.getByLabelText( - 'Upload any additional supporting documents' + 'Upload contract-supporting documents' ) expect(input).toBeInTheDocument() expect(input).toHaveAttribute('accept', ACCEPTED_SUBMISSION_FILE_TYPES) @@ -195,7 +195,7 @@ describe('Documents', () => { } ) const input = screen.getByLabelText( - 'Upload any additional supporting documents' + 'Upload contract-supporting documents' ) await userEvent.upload(input, [TEST_DOC_FILE]) await userEvent.upload(input, [TEST_PDF_FILE]) @@ -231,7 +231,7 @@ describe('Documents', () => { } ) const input = screen.getByLabelText( - 'Upload any additional supporting documents' + 'Upload contract-supporting documents' ) await userEvent.upload(input, [TEST_XLS_FILE]) @@ -281,7 +281,7 @@ describe('Documents', () => { } ) const input = screen.getByLabelText( - 'Upload any additional supporting documents' + 'Upload contract-supporting documents' ) await userEvent.upload(input, [TEST_DOC_FILE]) await userEvent.upload(input, [TEST_PDF_FILE]) @@ -328,7 +328,7 @@ describe('Documents', () => { ) const input = screen.getByLabelText( - 'Upload any additional supporting documents' + 'Upload contract-supporting documents' ) await userEvent.upload(input, [TEST_PDF_FILE]) await userEvent.upload(input, [TEST_DOC_FILE]) @@ -393,7 +393,7 @@ describe('Documents', () => { ) const input = screen.getByLabelText( - 'Upload any additional supporting documents' + 'Upload contract-supporting documents' ) await userEvent.upload(input, [TEST_DOC_FILE]) @@ -449,7 +449,7 @@ describe('Documents', () => { name: 'Continue', }) const input = screen.getByLabelText( - 'Upload any additional supporting documents' + 'Upload contract-supporting documents' ) await userEvent.upload(input, [TEST_DOC_FILE]) @@ -481,7 +481,7 @@ describe('Documents', () => { name: 'Continue', }) const input = screen.getByLabelText( - 'Upload any additional supporting documents' + 'Upload contract-supporting documents' ) const targetEl = screen.getByTestId('file-input-droptarget') @@ -514,7 +514,7 @@ describe('Documents', () => { } ) const input = screen.getByLabelText( - 'Upload any additional supporting documents' + 'Upload contract-supporting documents' ) const saveAsDraftButton = screen.getByRole('button', { name: 'Save as draft', @@ -597,7 +597,7 @@ describe('Documents', () => { }) const input = screen.getByLabelText( - 'Upload any additional supporting documents' + 'Upload contract-supporting documents' ) const targetEl = screen.getByTestId('file-input-droptarget') @@ -687,7 +687,7 @@ describe('Documents', () => { name: 'Save as draft', }) const input = screen.getByLabelText( - 'Upload any additional supporting documents' + 'Upload contract-supporting documents' ) await userEvent.upload(input, [TEST_DOC_FILE]) @@ -719,7 +719,7 @@ describe('Documents', () => { name: 'Save as draft', }) const input = screen.getByLabelText( - 'Upload any additional supporting documents' + 'Upload contract-supporting documents' ) const targetEl = screen.getByTestId('file-input-droptarget') @@ -778,7 +778,7 @@ describe('Documents', () => { } ) const input = screen.getByLabelText( - 'Upload any additional supporting documents' + 'Upload contract-supporting documents' ) const saveAsDraftButton = screen.getByRole('button', { name: 'Save as draft', @@ -831,7 +831,7 @@ describe('Documents', () => { name: 'Back', }) const input = screen.getByLabelText( - 'Upload any additional supporting documents' + 'Upload contract-supporting documents' ) await userEvent.upload(input, [TEST_DOC_FILE]) @@ -863,7 +863,7 @@ describe('Documents', () => { name: 'Back', }) const input = screen.getByLabelText( - 'Upload any additional supporting documents' + 'Upload contract-supporting documents' ) const targetEl = screen.getByTestId('file-input-droptarget') @@ -923,7 +923,7 @@ describe('Documents', () => { } ) const input = screen.getByLabelText( - 'Upload any additional supporting documents' + 'Upload contract-supporting documents' ) const backButton = screen.getByRole('button', { name: 'Back', @@ -1005,7 +1005,7 @@ describe('Documents', () => { ) const input = screen.getByLabelText( - 'Upload any additional supporting documents' + 'Upload contract-supporting documents' ) await userEvent.upload(input, [TEST_DOC_FILE]) @@ -1057,7 +1057,7 @@ describe('Documents', () => { ) const input = screen.getByLabelText( - 'Upload any additional supporting documents' + 'Upload contract-supporting documents' ) await userEvent.upload(input, [TEST_DOC_FILE]) @@ -1175,7 +1175,7 @@ describe('Documents', () => { name: 'Continue', }) const input = screen.getByLabelText( - 'Upload any additional supporting documents' + 'Upload contract-supporting documents' ) expect(input).toBeInTheDocument() @@ -1238,7 +1238,7 @@ describe('Documents', () => { name: 'Continue', }) const input = screen.getByLabelText( - 'Upload any additional supporting documents' + 'Upload contract-supporting documents' ) expect(input).toBeInTheDocument() await userEvent.upload(input, [TEST_DOC_FILE]) diff --git a/services/app-web/src/pages/StateSubmission/RateDetails/RateDetails.test.tsx b/services/app-web/src/pages/StateSubmission/RateDetails/RateDetails.test.tsx index 8650e8a52e..40e343eb0f 100644 --- a/services/app-web/src/pages/StateSubmission/RateDetails/RateDetails.test.tsx +++ b/services/app-web/src/pages/StateSubmission/RateDetails/RateDetails.test.tsx @@ -78,7 +78,7 @@ describe('RateDetails', () => { screen.getByText('Rate certification type') ).toBeInTheDocument() expect( - screen.getByText('Upload rate certification') + screen.getByText('Upload one rate certification document') ).toBeInTheDocument() expect( screen.getByRole('button', { name: 'Continue' }) @@ -275,7 +275,9 @@ describe('RateDetails', () => { 'Certification of capitation rates specific to each rate cell' ) .click() - const input = screen.getByLabelText('Upload rate certification') + const input = screen.getByLabelText( + 'Upload one rate certification document' + ) await userEvent.upload(input, [TEST_XLS_FILE]) const hasSharedRateFieldset = screen .getByText( @@ -452,7 +454,9 @@ describe('RateDetails', () => { } ) - const input = screen.getByLabelText('Upload rate certification') + const input = screen.getByLabelText( + 'Upload one rate certification document' + ) expect(input).toBeInTheDocument() await userEvent.upload(input, [TEST_DOC_FILE]) @@ -475,7 +479,9 @@ describe('RateDetails', () => { } ) - const input = screen.getByLabelText('Upload rate certification') + const input = screen.getByLabelText( + 'Upload one rate certification document' + ) expect(input).toBeInTheDocument() expect(input).toHaveAttribute( 'accept', @@ -580,7 +586,7 @@ describe('RateDetails', () => { const newRateCert = lastRateCertificationFromList(screen) expect(newRateCert).toBeDefined() const newRateInput = within(newRateCert!).getByLabelText( - 'Upload rate certification' + 'Upload one rate certification document' ) expect(newRateInput).toBeInTheDocument() @@ -1184,7 +1190,9 @@ describe('RateDetails', () => { const continueButton = screen.getByRole('button', { name: 'Continue', }) - const input = screen.getByLabelText('Upload rate certification') + const input = screen.getByLabelText( + 'Upload one rate certification document' + ) await userEvent.upload(input, [TEST_DOC_FILE]) @@ -1210,7 +1218,9 @@ describe('RateDetails', () => { const continueButton = screen.getByRole('button', { name: 'Continue', }) - const input = screen.getByLabelText('Upload rate certification') + const input = screen.getByLabelText( + 'Upload one rate certification document' + ) const targetEl = screen.getByTestId('file-input-droptarget') await userEvent.upload(input, [TEST_DOC_FILE]) @@ -1268,7 +1278,9 @@ describe('RateDetails', () => { } ) - const input = screen.getByLabelText('Upload rate certification') + const input = screen.getByLabelText( + 'Upload one rate certification document' + ) const continueButton = screen.getByRole('button', { name: 'Continue', }) @@ -1396,7 +1408,9 @@ describe('RateDetails', () => { const saveAsDraftButton = screen.getByRole('button', { name: 'Save as draft', }) - const input = screen.getByLabelText('Upload rate certification') + const input = screen.getByLabelText( + 'Upload one rate certification document' + ) await userEvent.upload(input, [TEST_DOC_FILE]) @@ -1423,7 +1437,9 @@ describe('RateDetails', () => { const saveAsDraftButton = screen.getByRole('button', { name: 'Save as draft', }) - const input = screen.getByLabelText('Upload rate certification') + const input = screen.getByLabelText( + 'Upload one rate certification document' + ) const targetEl = screen.getByTestId('file-input-droptarget') await userEvent.upload(input, [TEST_DOC_FILE]) @@ -1517,7 +1533,9 @@ describe('RateDetails', () => { }, } ) - const input = screen.getByLabelText('Upload rate certification') + const input = screen.getByLabelText( + 'Upload one rate certification document' + ) const saveAsDraftButton = screen.getByRole('button', { name: 'Save as draft', }) @@ -1561,7 +1579,9 @@ describe('RateDetails', () => { const backButton = screen.getByRole('button', { name: 'Back', }) - const input = screen.getByLabelText('Upload rate certification') + const input = screen.getByLabelText( + 'Upload one rate certification document' + ) await userEvent.upload(input, [TEST_DOC_FILE]) @@ -1587,7 +1607,9 @@ describe('RateDetails', () => { const backButton = screen.getByRole('button', { name: 'Back', }) - const input = screen.getByLabelText('Upload rate certification') + const input = screen.getByLabelText( + 'Upload one rate certification document' + ) const targetEl = screen.getByTestId('file-input-droptarget') await userEvent.upload(input, [TEST_DOC_FILE]) @@ -1649,7 +1671,7 @@ describe('RateDetails', () => { ) const rateCertInput = screen.getByLabelText( - 'Upload rate certification' + 'Upload one rate certification document' ) const supportingDocsInput = screen.getByLabelText( 'Upload supporting documents (optional)' @@ -1726,7 +1748,7 @@ const fillOutIndexRate = async (screen: Screen, index: number) => { // assert proper initial fields are present expect( - withinTargetRateCert.getByText('Upload rate certification') + withinTargetRateCert.getByText('Upload one rate certification document') ).toBeInTheDocument() expect( withinTargetRateCert.getByText( @@ -1754,7 +1776,7 @@ const fillOutIndexRate = async (screen: Screen, index: number) => { // add 1 doc const input = withinTargetRateCert.getByLabelText( - 'Upload rate certification' + 'Upload one rate certification document' ) await userEvent.upload(input, [TEST_DOC_FILE]) diff --git a/services/app-web/src/pages/StateSubmission/RateDetails/SingleRateCert/SingleRateCert.tsx b/services/app-web/src/pages/StateSubmission/RateDetails/SingleRateCert/SingleRateCert.tsx index f532410af9..6c06c9d969 100644 --- a/services/app-web/src/pages/StateSubmission/RateDetails/SingleRateCert/SingleRateCert.tsx +++ b/services/app-web/src/pages/StateSubmission/RateDetails/SingleRateCert/SingleRateCert.tsx @@ -146,12 +146,12 @@ export const SingleRateCert = ({ data-testid={`rate-certification-form`} key={key} id={`${fieldNamePrefix}.container.${rateInfo.id}`} + className={styles.rateCertContainer} legend={ displayAsStandaloneRate ? `Rate certification` : `Rate certification ${rateCertNumber}` } - className={styles.rateCertContainer} > { await waitFor(() => { expect( - screen.getByText( - 'Upload any additional supporting documents' - ) + screen.getByText('Upload contract-supporting documents') ).toBeInTheDocument() expect(screen.getByTestId('file-input')).toBeInTheDocument() }) From e6d5edddd68dfd5cc4cf17c780d14f3a2a8a2786 Mon Sep 17 00:00:00 2001 From: pearl-truss Date: Fri, 1 Sep 2023 12:22:22 -0400 Subject: [PATCH 05/17] temp test with supporting docs being true --- .../RateDetails/SingleRateCert/SingleRateCert.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/services/app-web/src/pages/StateSubmission/RateDetails/SingleRateCert/SingleRateCert.tsx b/services/app-web/src/pages/StateSubmission/RateDetails/SingleRateCert/SingleRateCert.tsx index 6c06c9d969..2e1dad0790 100644 --- a/services/app-web/src/pages/StateSubmission/RateDetails/SingleRateCert/SingleRateCert.tsx +++ b/services/app-web/src/pages/StateSubmission/RateDetails/SingleRateCert/SingleRateCert.tsx @@ -121,10 +121,11 @@ export const SingleRateCert = ({ featureFlags.PACKAGES_WITH_SHARED_RATES.flag, featureFlags.PACKAGES_WITH_SHARED_RATES.defaultValue ) - const supportingDocsByRate = ldClient?.variation( - featureFlags.SUPPORTING_DOCS_BY_RATE.flag, - featureFlags.SUPPORTING_DOCS_BY_RATE.defaultValue - ) + // const supportingDocsByRate = ldClient?.variation( + // featureFlags.SUPPORTING_DOCS_BY_RATE.flag, + // featureFlags.SUPPORTING_DOCS_BY_RATE.defaultValue + // ) + const supportingDocsByRate = true // page level setup const { handleDeleteFile, handleUploadFile, handleScanFile } = useS3() From 7f25be6af38a27d87cfa8a38808fd6dac3bc8446 Mon Sep 17 00:00:00 2001 From: pearl-truss Date: Fri, 1 Sep 2023 14:16:28 -0400 Subject: [PATCH 06/17] reset supportingDocsRate value --- .../RateDetails/SingleRateCert/SingleRateCert.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/services/app-web/src/pages/StateSubmission/RateDetails/SingleRateCert/SingleRateCert.tsx b/services/app-web/src/pages/StateSubmission/RateDetails/SingleRateCert/SingleRateCert.tsx index 2e1dad0790..6c06c9d969 100644 --- a/services/app-web/src/pages/StateSubmission/RateDetails/SingleRateCert/SingleRateCert.tsx +++ b/services/app-web/src/pages/StateSubmission/RateDetails/SingleRateCert/SingleRateCert.tsx @@ -121,11 +121,10 @@ export const SingleRateCert = ({ featureFlags.PACKAGES_WITH_SHARED_RATES.flag, featureFlags.PACKAGES_WITH_SHARED_RATES.defaultValue ) - // const supportingDocsByRate = ldClient?.variation( - // featureFlags.SUPPORTING_DOCS_BY_RATE.flag, - // featureFlags.SUPPORTING_DOCS_BY_RATE.defaultValue - // ) - const supportingDocsByRate = true + const supportingDocsByRate = ldClient?.variation( + featureFlags.SUPPORTING_DOCS_BY_RATE.flag, + featureFlags.SUPPORTING_DOCS_BY_RATE.defaultValue + ) // page level setup const { handleDeleteFile, handleUploadFile, handleScanFile } = useS3() From c6687457b14221f18d02d1bbda5a00d4a95a0c32 Mon Sep 17 00:00:00 2001 From: pearl-truss Date: Fri, 1 Sep 2023 17:00:18 -0400 Subject: [PATCH 07/17] cypress re-run From d622210b3f319f16b4f552b25e09e61675d1f278 Mon Sep 17 00:00:00 2001 From: pearl-truss Date: Tue, 5 Sep 2023 12:21:40 -0400 Subject: [PATCH 08/17] cypress re-run From 49a753bf8a617582ac3e68572ba7673e2ebdddd9 Mon Sep 17 00:00:00 2001 From: pearl-truss Date: Tue, 5 Sep 2023 13:03:36 -0400 Subject: [PATCH 09/17] cypress re-run From 1027f7ac4bbcb243a3d8fbf7800822b0ad8543e0 Mon Sep 17 00:00:00 2001 From: pearl-truss Date: Wed, 6 Sep 2023 13:14:32 -0400 Subject: [PATCH 10/17] create new constant for acceptable file types for rate certification --- services/app-web/src/components/FileUpload/constants.ts | 3 +++ services/app-web/src/components/FileUpload/index.ts | 5 ++++- .../pages/StateSubmission/RateDetails/RateDetails.test.tsx | 4 ++-- .../RateDetails/SingleRateCert/SingleRateCert.tsx | 7 +++++-- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/services/app-web/src/components/FileUpload/constants.ts b/services/app-web/src/components/FileUpload/constants.ts index dbc77c0d87..cec25bc027 100644 --- a/services/app-web/src/components/FileUpload/constants.ts +++ b/services/app-web/src/components/FileUpload/constants.ts @@ -3,3 +3,6 @@ export const SPACER_GIF = export const ACCEPTED_SUBMISSION_FILE_TYPES = 'application/pdf,text/csv,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel.sheet.macroEnabled.12,application/vnd.ms-excel.template.macroEnabled.12,application/vnd.ms-excel.addin.macroEnabled.12' + +export const ACCEPTED_RATE_CERTIFICATION_FILE_TYPES = + 'application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document' diff --git a/services/app-web/src/components/FileUpload/index.ts b/services/app-web/src/components/FileUpload/index.ts index d14f62374e..8bffadc4b8 100644 --- a/services/app-web/src/components/FileUpload/index.ts +++ b/services/app-web/src/components/FileUpload/index.ts @@ -3,7 +3,10 @@ export type { S3FileData } from './FileUpload' export { UploadErrorAlert } from './UploadErrorAlert/UploadErrorAlert' export { FileUpload } from './FileUpload' -export { ACCEPTED_SUBMISSION_FILE_TYPES } from './constants' +export { + ACCEPTED_SUBMISSION_FILE_TYPES, + ACCEPTED_RATE_CERTIFICATION_FILE_TYPES, +} from './constants' export { hasNoLoadingFiles, hasNoFileErrors, diff --git a/services/app-web/src/pages/StateSubmission/RateDetails/RateDetails.test.tsx b/services/app-web/src/pages/StateSubmission/RateDetails/RateDetails.test.tsx index 40e343eb0f..25d88ebdbf 100644 --- a/services/app-web/src/pages/StateSubmission/RateDetails/RateDetails.test.tsx +++ b/services/app-web/src/pages/StateSubmission/RateDetails/RateDetails.test.tsx @@ -28,7 +28,7 @@ import { ldUseClientSpy, } from '../../../testHelpers' import { RateDetails } from './RateDetails' -import { ACCEPTED_SUBMISSION_FILE_TYPES } from '../../../components/FileUpload' +import { ACCEPTED_RATE_CERTIFICATION_FILE_TYPES } from '../../../components/FileUpload' import selectEvent from 'react-select-event' import * as useStatePrograms from '../../../hooks/useStatePrograms' import { unlockedWithALittleBitOfEverything } from '../../../common-code/healthPlanFormDataMocks' @@ -485,7 +485,7 @@ describe('RateDetails', () => { expect(input).toBeInTheDocument() expect(input).toHaveAttribute( 'accept', - ACCEPTED_SUBMISSION_FILE_TYPES + ACCEPTED_RATE_CERTIFICATION_FILE_TYPES ) await userEvent.upload(input, [ TEST_DOC_FILE, diff --git a/services/app-web/src/pages/StateSubmission/RateDetails/SingleRateCert/SingleRateCert.tsx b/services/app-web/src/pages/StateSubmission/RateDetails/SingleRateCert/SingleRateCert.tsx index 6c06c9d969..1236d6828f 100644 --- a/services/app-web/src/pages/StateSubmission/RateDetails/SingleRateCert/SingleRateCert.tsx +++ b/services/app-web/src/pages/StateSubmission/RateDetails/SingleRateCert/SingleRateCert.tsx @@ -23,7 +23,10 @@ import { import styles from '../../StateSubmissionForm.module.scss' import { formatUserInputDate, isDateRangeEmpty } from '../../../../formHelpers' -import { ACCEPTED_SUBMISSION_FILE_TYPES } from '../../../../components/FileUpload' +import { + ACCEPTED_SUBMISSION_FILE_TYPES, + ACCEPTED_RATE_CERTIFICATION_FILE_TYPES, +} from '../../../../components/FileUpload' import { useS3 } from '../../../../contexts/S3Context' import { FormikErrors, getIn, useFormikContext } from 'formik' @@ -185,7 +188,7 @@ export const SingleRateCert = ({ } - accept={ACCEPTED_SUBMISSION_FILE_TYPES} + accept={ACCEPTED_RATE_CERTIFICATION_FILE_TYPES} initialItems={rateInfo.rateDocuments} uploadFile={(file) => handleUploadFile(file, 'HEALTH_PLAN_DOCS') From 5524a24052dd733faeb316279e22d82716982221 Mon Sep 17 00:00:00 2001 From: pearl-truss Date: Wed, 6 Sep 2023 13:22:18 -0400 Subject: [PATCH 11/17] update test to use new constant --- .../pages/StateSubmission/RateDetails/RateDetails.test.tsx | 7 +++++-- services/app-web/src/testHelpers/index.ts | 1 + services/app-web/src/testHelpers/jestHelpers.tsx | 5 +++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/services/app-web/src/pages/StateSubmission/RateDetails/RateDetails.test.tsx b/services/app-web/src/pages/StateSubmission/RateDetails/RateDetails.test.tsx index 25d88ebdbf..bd796d09c1 100644 --- a/services/app-web/src/pages/StateSubmission/RateDetails/RateDetails.test.tsx +++ b/services/app-web/src/pages/StateSubmission/RateDetails/RateDetails.test.tsx @@ -20,6 +20,7 @@ import { import { renderWithProviders, TEST_DOC_FILE, + TEST_DOCX_FILE, TEST_PDF_FILE, TEST_XLS_FILE, TEST_PNG_FILE, @@ -490,12 +491,14 @@ describe('RateDetails', () => { await userEvent.upload(input, [ TEST_DOC_FILE, TEST_PDF_FILE, - TEST_XLS_FILE, + TEST_DOCX_FILE, ]) await waitFor(() => { expect(screen.getByText(TEST_DOC_FILE.name)).toBeInTheDocument() expect(screen.getByText(TEST_PDF_FILE.name)).toBeInTheDocument() - expect(screen.getByText(TEST_XLS_FILE.name)).toBeInTheDocument() + expect( + screen.getByText(TEST_DOCX_FILE.name) + ).toBeInTheDocument() }) }) }) diff --git a/services/app-web/src/testHelpers/index.ts b/services/app-web/src/testHelpers/index.ts index 663544fdcd..fa68adbe06 100644 --- a/services/app-web/src/testHelpers/index.ts +++ b/services/app-web/src/testHelpers/index.ts @@ -13,6 +13,7 @@ export { userClickSignIn, ldUseClientSpy, TEST_DOC_FILE, + TEST_DOCX_FILE, TEST_PDF_FILE, TEST_PNG_FILE, TEST_TEXT_FILE, diff --git a/services/app-web/src/testHelpers/jestHelpers.tsx b/services/app-web/src/testHelpers/jestHelpers.tsx index 192ec77876..2610de2b11 100644 --- a/services/app-web/src/testHelpers/jestHelpers.tsx +++ b/services/app-web/src/testHelpers/jestHelpers.tsx @@ -195,6 +195,10 @@ const TEST_DOC_FILE = new File(['Test doc File'], 'testFile.doc', { type: 'application/msword', }) +const TEST_DOCX_FILE = new File(['Test doc File'], 'testFile.doc', { + type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', +}) + const TEST_XLS_FILE = new File(['Test xls File'], 'testFile.xls', { type: 'application/vnd.ms-excel', }) @@ -218,6 +222,7 @@ export { ldUseClientSpy, selectYesNoRadio, TEST_DOC_FILE, + TEST_DOCX_FILE, TEST_PDF_FILE, TEST_PNG_FILE, TEST_TEXT_FILE, From 2547deb8d8d06053a56feb737d464d960a0b5e05 Mon Sep 17 00:00:00 2001 From: pearl-truss Date: Wed, 6 Sep 2023 13:32:38 -0400 Subject: [PATCH 12/17] fix file type extension for docx type --- services/app-web/src/testHelpers/jestHelpers.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/app-web/src/testHelpers/jestHelpers.tsx b/services/app-web/src/testHelpers/jestHelpers.tsx index 2610de2b11..c0855d211e 100644 --- a/services/app-web/src/testHelpers/jestHelpers.tsx +++ b/services/app-web/src/testHelpers/jestHelpers.tsx @@ -195,7 +195,7 @@ const TEST_DOC_FILE = new File(['Test doc File'], 'testFile.doc', { type: 'application/msword', }) -const TEST_DOCX_FILE = new File(['Test doc File'], 'testFile.doc', { +const TEST_DOCX_FILE = new File(['Test doc File'], 'testFile.docx', { type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', }) From dff098e033a44acfd46f796f27269ef5b8d5b37d Mon Sep 17 00:00:00 2001 From: pearl-truss Date: Wed, 6 Sep 2023 13:33:09 -0400 Subject: [PATCH 13/17] fix file type extension for docx type --- services/app-web/src/testHelpers/jestHelpers.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/app-web/src/testHelpers/jestHelpers.tsx b/services/app-web/src/testHelpers/jestHelpers.tsx index c0855d211e..5e7b2ca483 100644 --- a/services/app-web/src/testHelpers/jestHelpers.tsx +++ b/services/app-web/src/testHelpers/jestHelpers.tsx @@ -195,7 +195,7 @@ const TEST_DOC_FILE = new File(['Test doc File'], 'testFile.doc', { type: 'application/msword', }) -const TEST_DOCX_FILE = new File(['Test doc File'], 'testFile.docx', { +const TEST_DOCX_FILE = new File(['Test docx File'], 'testFile.docx', { type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', }) From 7295617877fec67e822e9ed33866135dcc8856ad Mon Sep 17 00:00:00 2001 From: pearl-truss Date: Wed, 6 Sep 2023 13:54:29 -0400 Subject: [PATCH 14/17] replace xls with docs file type since xls no longer accepted for rate uploads --- .../src/pages/StateSubmission/RateDetails/RateDetails.test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/app-web/src/pages/StateSubmission/RateDetails/RateDetails.test.tsx b/services/app-web/src/pages/StateSubmission/RateDetails/RateDetails.test.tsx index bd796d09c1..9784933bc4 100644 --- a/services/app-web/src/pages/StateSubmission/RateDetails/RateDetails.test.tsx +++ b/services/app-web/src/pages/StateSubmission/RateDetails/RateDetails.test.tsx @@ -279,7 +279,7 @@ describe('RateDetails', () => { const input = screen.getByLabelText( 'Upload one rate certification document' ) - await userEvent.upload(input, [TEST_XLS_FILE]) + await userEvent.upload(input, [TEST_DOC_FILE]) const hasSharedRateFieldset = screen .getByText( /Was this rate certification uploaded to any other submissions/ From 05427660546ce7bff8ce0c317eba09863fbb0323 Mon Sep 17 00:00:00 2001 From: pearl-truss Date: Wed, 6 Sep 2023 13:55:57 -0400 Subject: [PATCH 15/17] cypress re-run From e98271b19d857214ca84e870b852cb38f1de3946 Mon Sep 17 00:00:00 2001 From: pearl-truss Date: Wed, 6 Sep 2023 14:32:41 -0400 Subject: [PATCH 16/17] cypress re-run --- .../src/pages/StateSubmission/RateDetails/RateDetails.test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/app-web/src/pages/StateSubmission/RateDetails/RateDetails.test.tsx b/services/app-web/src/pages/StateSubmission/RateDetails/RateDetails.test.tsx index 9784933bc4..1995959d84 100644 --- a/services/app-web/src/pages/StateSubmission/RateDetails/RateDetails.test.tsx +++ b/services/app-web/src/pages/StateSubmission/RateDetails/RateDetails.test.tsx @@ -1781,7 +1781,7 @@ const fillOutIndexRate = async (screen: Screen, index: number) => { const input = withinTargetRateCert.getByLabelText( 'Upload one rate certification document' ) - await userEvent.upload(input, [TEST_DOC_FILE]) + await userEvent.upload(input, [TEST_PDF_FILE]) // add programs const combobox = await withinTargetRateCert.findByRole('combobox') From 689dcfa5c30244e9eef9452b08a9b39025a2faa3 Mon Sep 17 00:00:00 2001 From: pearl-truss Date: Wed, 6 Sep 2023 15:05:16 -0400 Subject: [PATCH 17/17] cypress re-run