generated from DEFRA/ffc-template-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: change application details tabs content (#50)
* feat: change application details tabs content * bump: version * fix: linting * feat: fix broken tests * feat: fix broken tests * feat: change eligible test * fix: error message text
- Loading branch information
1 parent
5d752e4
commit 7245a90
Showing
11 changed files
with
40 additions
and
33 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
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 |
---|---|---|
@@ -1,15 +1,17 @@ | ||
const { formatedDateToUk, upperFirstLetter } = require('../../lib/display-helper') | ||
|
||
module.exports = (application) => { | ||
const { data } = application | ||
const { data, updatedAt } = application | ||
const formatedDate = formatedDateToUk(updatedAt) | ||
return { | ||
firstCellIsHeader: true, | ||
rows: [ | ||
[{ text: 'Date of claim' }, { text: formatedDate }], | ||
[{ text: 'Review details confirmed' }, { text: upperFirstLetter(data?.confirmCheckDetails) }], | ||
[{ text: 'Date of review' }, { text: formatedDateToUk(data?.visitDate) }], | ||
[{ text: 'Vet’s name' }, { text: data?.vetName }], | ||
[{ text: 'Vet’s RCVS number' }, { text: data?.vetRcvs }], | ||
[{ text: 'Unique reference number (URN)' }, { text: data?.urnResult }] | ||
[{ text: 'Test results unique reference number (URN)' }, { text: data?.urnResult }] | ||
] | ||
} | ||
} |
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
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
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
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
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
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
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
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
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 |
---|---|---|
|
@@ -38,8 +38,8 @@ describe('View Application test', () => { | |
expect($('h1.govuk-heading-l').text()).toEqual('400 - Bad Request') | ||
expectPhaseBanner.ok($) | ||
}) | ||
test('returns 200 application applied', async () => { | ||
applications.getApplication.mockReturnValueOnce(viewApplicationData.applied) | ||
test('returns 200 application agreed', async () => { | ||
applications.getApplication.mockReturnValueOnce(viewApplicationData.agreed) | ||
const options = { | ||
method: 'GET', | ||
url, | ||
|
@@ -64,7 +64,7 @@ describe('View Application test', () => { | |
expect($('.govuk-summary-list__key').eq(3).text()).toMatch('Email address:') | ||
expect($('.govuk-summary-list__value').eq(3).text()).toMatch('[email protected]') | ||
|
||
expect($('tbody tr:nth-child(1)').text()).toContain('Agreement formed') | ||
expect($('tbody tr:nth-child(1)').text()).toContain('Date of agreement') | ||
expect($('tbody tr:nth-child(1)').text()).toContain('06/06/2022') | ||
expect($('tbody tr:nth-child(2)').text()).toContain('Business details correct') | ||
expect($('tbody tr:nth-child(2)').text()).toContain('Yes') | ||
|
@@ -74,7 +74,7 @@ describe('View Application test', () => { | |
expect($('tbody tr:nth-child(4)').text()).toContain('At least 21') | ||
expect($('tbody tr:nth-child(5)').text()).toContain('Agreement accepted') | ||
expect($('tbody tr:nth-child(5)').text()).toContain('Yes') | ||
expect($('#claim').text()).toContain('Never claimed') | ||
expect($('#claim').text()).toContain('Not claimed yet') | ||
expectPhaseBanner.ok($) | ||
}) | ||
test('returns 200 application applied', async () => { | ||
|
@@ -103,7 +103,7 @@ describe('View Application test', () => { | |
expect($('.govuk-summary-list__key').eq(3).text()).toMatch('Email address:') | ||
expect($('.govuk-summary-list__value').eq(3).text()).toMatch('[email protected]') | ||
|
||
expect($('tbody tr:nth-child(1)').text()).toContain('Agreement not formed') | ||
expect($('tbody tr:nth-child(1)').text()).toContain('Date of agreement rejected') | ||
expect($('tbody tr:nth-child(1)').text()).toContain('06/06/2022') | ||
expect($('tbody tr:nth-child(2)').text()).toContain('Business details correct') | ||
expect($('tbody tr:nth-child(2)').text()).toContain('Yes') | ||
|
@@ -113,7 +113,7 @@ describe('View Application test', () => { | |
expect($('tbody tr:nth-child(4)').text()).toContain('At least 21') | ||
expect($('tbody tr:nth-child(5)').text()).toContain('Agreement accepted') | ||
expect($('tbody tr:nth-child(5)').text()).toContain('No') | ||
expect($('#claim').text()).toContain('Never claimed') | ||
expect($('#claim').text()).toContain('Not eligible to claim') | ||
expectPhaseBanner.ok($) | ||
}) | ||
test('returns 200 application data inputted', async () => { | ||
|
@@ -142,7 +142,7 @@ describe('View Application test', () => { | |
expect($('.govuk-summary-list__key').eq(3).text()).toMatch('Email address:') | ||
expect($('.govuk-summary-list__value').eq(3).text()).toMatch('[email protected]') | ||
|
||
expect($('#claim').text()).toContain('Never claimed') | ||
expect($('#claim').text()).toContain('Not eligible to claim') | ||
expectPhaseBanner.ok($) | ||
}) | ||
test('returns 200 application claim', async () => { | ||
|
@@ -173,16 +173,18 @@ describe('View Application test', () => { | |
|
||
expect($('#claim').text()).toContain('Claimed') | ||
|
||
expect($('tbody:nth-child(1) tr:nth-child(1)').text()).toContain('Review details confirmed') | ||
expect($('tbody:nth-child(1) tr:nth-child(1)').text()).toContain('Yes') | ||
expect($('tbody:nth-child(1) tr:nth-child(2)').text()).toContain('Date of review') | ||
expect($('tbody:nth-child(1) tr:nth-child(2)').text()).toContain('07/11/2022') | ||
expect($('tbody:nth-child(1) tr:nth-child(3)').text()).toContain('Vet’s name') | ||
expect($('tbody:nth-child(1) tr:nth-child(3)').text()).toContain('testVet') | ||
expect($('tbody:nth-child(1) tr:nth-child(4)').text()).toContain('Vet’s RCVS number') | ||
expect($('tbody:nth-child(1) tr:nth-child(4)').text()).toContain('1234234') | ||
expect($('tbody:nth-child(1) tr:nth-child(5)').text()).toContain('Unique reference number (URN)') | ||
expect($('tbody:nth-child(1) tr:nth-child(5)').text()).toContain('134242') | ||
expect($('tbody:nth-child(1) tr:nth-child(1)').text()).toContain('Date of claim') | ||
expect($('tbody:nth-child(1) tr:nth-child(1)').text()).toContain('07/12/2022') | ||
expect($('tbody:nth-child(1) tr:nth-child(2)').text()).toContain('Review details confirmed') | ||
expect($('tbody:nth-child(1) tr:nth-child(2)').text()).toContain('Yes') | ||
expect($('tbody:nth-child(1) tr:nth-child(3)').text()).toContain('Date of review') | ||
expect($('tbody:nth-child(1) tr:nth-child(3)').text()).toContain('07/11/2022') | ||
expect($('tbody:nth-child(1) tr:nth-child(4)').text()).toContain('Vet’s name') | ||
expect($('tbody:nth-child(1) tr:nth-child(4)').text()).toContain('testVet') | ||
expect($('tbody:nth-child(1) tr:nth-child(5)').text()).toContain('Vet’s RCVS number') | ||
expect($('tbody:nth-child(1) tr:nth-child(5)').text()).toContain('1234234') | ||
expect($('tbody:nth-child(1) tr:nth-child(6)').text()).toContain('Test results unique reference number (URN)') | ||
expect($('tbody:nth-child(1) tr:nth-child(6)').text()).toContain('134242') | ||
expectPhaseBanner.ok($) | ||
}) | ||
test('returns 200 application paid', async () => { | ||
|