Skip to content

Commit

Permalink
- Adding branch coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
elipe17 committed Sep 8, 2023
1 parent eae8d3c commit 8408f66
Showing 1 changed file with 120 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down Expand Up @@ -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()
})
})

0 comments on commit 8408f66

Please sign in to comment.