forked from HHS/TANF-app
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
120 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -344,8 +344,8 @@ describe('SubmissionHistory', () => { | |
'Accepted with Errors', | ||
'Partially Accepted with Errors', | ||
'Rejected', | ||
null, | ||
])('Shows the submission acceptance status', (status) => { | ||
null | ||
])('Shows the submission acceptance status section 1', (status) => { | ||
const state = { | ||
reports: { | ||
files: [ | ||
|
@@ -396,4 +396,122 @@ describe('SubmissionHistory', () => { | |
expect(screen.queryByText('test1.txt')).toBeInTheDocument() | ||
expect(screen.queryByText(status || 'Pending')).toBeInTheDocument() | ||
}) | ||
|
||
it.each([ | ||
'Pending', | ||
'Accepted', | ||
'Accepted with Errors', | ||
'Partially Accepted with Errors', | ||
'Rejected', | ||
null | ||
])('Shows the submission acceptance status section 2', (status) => { | ||
const state = { | ||
reports: { | ||
files: [ | ||
{ | ||
id: '123', | ||
fileName: 'test1.txt', | ||
fileType: 'TANF', | ||
quarter: 'Q1', | ||
section: 'Closed Case Data', | ||
uuid: '123-4-4-321', | ||
year: '2023', | ||
s3_version_id: '321-0-0-123', | ||
createdAt: '12/12/2012 12:12', | ||
submittedBy: '[email protected]', | ||
summary: { | ||
datafile: '123', | ||
status: status, | ||
case_aggregates: { | ||
Oct: { | ||
total: 0, | ||
accepted: 0, | ||
rejected: 0, | ||
}, | ||
Nov: { | ||
total: 0, | ||
accepted: 0, | ||
rejected: 0, | ||
}, | ||
Dec: { | ||
total: 0, | ||
accepted: 0, | ||
rejected: 0, | ||
}, | ||
}, | ||
}, | ||
}, | ||
], | ||
}, | ||
} | ||
|
||
const store = appConfigureStore(state) | ||
const dispatch = jest.fn(store.dispatch) | ||
store.dispatch = dispatch | ||
|
||
setup(store) | ||
|
||
expect(screen.queryByText('Status')).toBeInTheDocument() | ||
expect(screen.queryByText('test1.txt')).toBeInTheDocument() | ||
expect(screen.queryByText(status || 'Pending')).toBeInTheDocument() | ||
}) | ||
|
||
it.each([ | ||
'Pending', | ||
'Accepted', | ||
'Accepted with Errors', | ||
'Partially Accepted with Errors', | ||
'Rejected', | ||
null | ||
])('Shows the submission acceptance status section 3', (status) => { | ||
const state = { | ||
reports: { | ||
files: [ | ||
{ | ||
id: '123', | ||
fileName: 'test1.txt', | ||
fileType: 'TANF', | ||
quarter: 'Q1', | ||
section: 'Aggregate Data', | ||
uuid: '123-4-4-321', | ||
year: '2023', | ||
s3_version_id: '321-0-0-123', | ||
createdAt: '12/12/2012 12:12', | ||
submittedBy: '[email protected]', | ||
summary: { | ||
datafile: '123', | ||
status: status, | ||
case_aggregates: { | ||
Oct: { | ||
total: 0, | ||
accepted: 0, | ||
rejected: 0, | ||
}, | ||
Nov: { | ||
total: 0, | ||
accepted: 0, | ||
rejected: 0, | ||
}, | ||
Dec: { | ||
total: 0, | ||
accepted: 0, | ||
rejected: 0, | ||
}, | ||
}, | ||
}, | ||
}, | ||
], | ||
}, | ||
} | ||
|
||
const store = appConfigureStore(state) | ||
const dispatch = jest.fn(store.dispatch) | ||
store.dispatch = dispatch | ||
|
||
setup(store) | ||
|
||
expect(screen.queryByText('Status')).toBeInTheDocument() | ||
expect(screen.queryByText('test1.txt')).toBeInTheDocument() | ||
expect(screen.queryByText(status || 'Pending')).toBeInTheDocument() | ||
}) | ||
}) |