diff --git a/tdrs-frontend/src/components/SubmissionHistory/SubmissionHistory.test.js b/tdrs-frontend/src/components/SubmissionHistory/SubmissionHistory.test.js index 05a4a9879..325c7d898 100644 --- a/tdrs-frontend/src/components/SubmissionHistory/SubmissionHistory.test.js +++ b/tdrs-frontend/src/components/SubmissionHistory/SubmissionHistory.test.js @@ -474,272 +474,4 @@ describe('SubmissionHistory', () => { } } ) - - it('Shows the outdated submission banner for old submissions', () => { - const state = { - reports: { - files: [ - { - id: '123', - fileName: 'test1.txt', - fileType: 'TANF', - quarter: 'Q1', - section: 'Active Case Data', - uuid: '123-4-4-321', - year: '2023', - s3_version_id: '321-0-0-123', - createdAt: '08/08/2024 12:12', - submittedBy: 'test@teamraft.com', - summary: { - status: 'Accepted', - }, - has_outdated_error_report: false, - }, - { - id: '333', - fileName: 'test2.txt', - fileType: 'TANF', - quarter: 'Q1', - section: 'Active Case Data', - uuid: '123-4-4-321', - year: '2023', - s3_version_id: '321-0-0-123', - createdAt: '12/12/2012 12:12', - submittedBy: 'test@teamraft.com', - summary: { - status: 'Accepted', - }, - has_outdated_error_report: true, - }, - ], - }, - } - - const store = appConfigureStore(state) - const dispatch = jest.fn(store.dispatch) - store.dispatch = dispatch - - setup(store) - - expect(screen.queryByText('test1.txt')).toBeInTheDocument() - expect(screen.queryByText('test2.txt')).toBeInTheDocument() - expect( - screen.queryByText( - 'Please note that error reports and submission history content for files submitted prior to May 31, 2024 may be outdated. Please resubmit to get access to updated information.' - ) - ).toBeInTheDocument() - expect( - screen.queryByText( - 'This file was submitted prior to May 31, 2024. Please resubmit to get access to updated information.' - ) - ).toBeInTheDocument() - }) - - it('Shows the outdated submission banner for old submissions with old reparses', () => { - const state = { - reports: { - files: [ - { - id: '123', - fileName: 'test1.txt', - fileType: 'TANF', - quarter: 'Q1', - section: 'Active Case Data', - uuid: '123-4-4-321', - year: '2023', - s3_version_id: '321-0-0-123', - createdAt: '08/08/2024 12:12', - submittedBy: 'test@teamraft.com', - summary: { - status: 'Accepted', - }, - reparse_file_metas: [ - { - finished: true, - success: true, - started_at: '2024-10-24T12:39:21+0000', - finished_at: '2023-10-11T00:00:00+0000', - }, - { - finished: true, - success: true, - started_at: '2024-10-24T13:09:15+0000', - finished_at: '2023-10-11T00:00:00+0000', - }, - ], - has_outdated_error_report: true, - }, - { - id: '333', - fileName: 'test2.txt', - fileType: 'TANF', - quarter: 'Q1', - section: 'Active Case Data', - uuid: '123-4-4-321', - year: '2023', - s3_version_id: '321-0-0-123', - createdAt: '12/12/2012 12:12', - submittedBy: 'test@teamraft.com', - summary: { - status: 'Accepted', - }, - has_outdated_error_report: false, - }, - ], - }, - } - - const store = appConfigureStore(state) - const dispatch = jest.fn(store.dispatch) - store.dispatch = dispatch - - setup(store) - - expect(screen.queryByText('test1.txt')).toBeInTheDocument() - expect(screen.queryByText('test2.txt')).toBeInTheDocument() - expect( - screen.queryByText( - 'Please note that error reports and submission history content for files submitted prior to May 31, 2024 may be outdated. Please resubmit to get access to updated information.' - ) - ).toBeInTheDocument() - expect( - screen.queryByText( - 'This file was submitted prior to May 31, 2024. Please resubmit to get access to updated information.' - ) - ).toBeInTheDocument() - }) - - it('Does not show outdated submissions banner if no old submissions', () => { - const state = { - reports: { - files: [ - { - id: '123', - fileName: 'test1.txt', - fileType: 'TANF', - quarter: 'Q1', - section: 'Active Case Data', - uuid: '123-4-4-321', - year: '2023', - s3_version_id: '321-0-0-123', - createdAt: '08/08/2024 12:12', - submittedBy: 'test@teamraft.com', - summary: { - status: 'Accepted', - }, - has_outdated_error_report: false, - }, - { - id: '333', - fileName: 'test2.txt', - fileType: 'TANF', - quarter: 'Q1', - section: 'Active Case Data', - uuid: '123-4-4-321', - year: '2023', - s3_version_id: '321-0-0-123', - createdAt: '12/12/2024 12:12', - submittedBy: 'test@teamraft.com', - summary: { - status: 'Accepted', - }, - has_outdated_error_report: false, - }, - ], - }, - } - - const store = appConfigureStore(state) - const dispatch = jest.fn(store.dispatch) - store.dispatch = dispatch - - setup(store) - - expect(screen.queryByText('test1.txt')).toBeInTheDocument() - expect(screen.queryByText('test2.txt')).toBeInTheDocument() - expect( - screen.queryByText( - 'Please note that error reports and submission history content for files submitted prior to May 31, 2024 may be outdated. Please resubmit to get access to updated information.' - ) - ).not.toBeInTheDocument() - expect( - screen.queryByText( - 'This file was submitted prior to May 31, 2024. Please resubmit to get access to updated information.' - ) - ).not.toBeInTheDocument() - }) - - it('Does not show the outdated submission banner for old submissions with new reparses', () => { - const state = { - reports: { - files: [ - { - id: '123', - fileName: 'test1.txt', - fileType: 'TANF', - quarter: 'Q1', - section: 'Active Case Data', - uuid: '123-4-4-321', - year: '2023', - s3_version_id: '321-0-0-123', - createdAt: '08/08/2024 12:12', - submittedBy: 'test@teamraft.com', - summary: { - status: 'Accepted', - }, - reparse_file_metas: [ - { - finished: true, - success: true, - started_at: '2024-10-24T12:39:21+0000', - finished_at: '2024-10-11T00:00:00+0000', - }, - { - finished: true, - success: true, - started_at: '2024-10-24T13:09:15+0000', - finished_at: '2023-10-11T00:00:00+0000', - }, - ], - has_outdated_error_report: false, - }, - { - id: '333', - fileName: 'test2.txt', - fileType: 'TANF', - quarter: 'Q1', - section: 'Active Case Data', - uuid: '123-4-4-321', - year: '2023', - s3_version_id: '321-0-0-123', - createdAt: '12/12/2012 12:12', - submittedBy: 'test@teamraft.com', - summary: { - status: 'Accepted', - }, - has_outdated_error_report: false, - }, - ], - }, - } - - const store = appConfigureStore(state) - const dispatch = jest.fn(store.dispatch) - store.dispatch = dispatch - - setup(store) - - expect(screen.queryByText('test1.txt')).toBeInTheDocument() - expect(screen.queryByText('test2.txt')).toBeInTheDocument() - expect( - screen.queryByText( - 'Please note that error reports and submission history content for files submitted prior to May 31, 2024 may be outdated. Please resubmit to get access to updated information.' - ) - ).not.toBeInTheDocument() - expect( - screen.queryByText( - 'This file was submitted prior to May 31, 2024. Please resubmit to get access to updated information.' - ) - ).not.toBeInTheDocument() - }) })