Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove: vet tab #40

Merged
merged 3 commits into from
Oct 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions app/routes/models/view-application.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
const getFarmerApplication = require('./farmer-application')
const getVetVisitData = require('./vet-visit-review')
const getOrganisationRows = require('./application-organisation')
const getPaymentData = require('./application-payment')
const getClaimData = require('./application-claim')

function ViewModel (application) {
this.model = {
applicationData: getFarmerApplication(application),
vetVisitData: application?.vetVisit ? getVetVisitData(application.vetVisit, application?.data?.whichReview) : false,
listData: { rows: getOrganisationRows(application?.data?.organisation) },
paymentData: application?.payment ? getPaymentData(application?.payment) : false,
claimData: application?.claimed ? getClaimData(application?.updatedAt) : false
Expand Down
16 changes: 0 additions & 16 deletions app/views/macros/view-application-tabs.njk
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,6 @@
{{ govukTable(model.applicationData) }}
{% endset -%}

{% set vetReviewHtml %}
{% if vetVisit %}
<h2 class="govuk-heading-l">Data inputted</h2>
{{ govukTable(model.vetVisitData) }}
{% else %}
<h2 class="govuk-heading-l">Not yet reviewed</h2>
{% endif %}
{% endset -%}

{% set claimHtml %}
{% if claimed %}
<h2 class="govuk-heading-l">Selected for fraud check</h2>
Expand Down Expand Up @@ -43,13 +34,6 @@
html: applicationHtml
}
},
{
label: "Vet Review",
id: "vet-review",
panel: {
html: vetReviewHtml
}
},
{
label: "Claim",
id: "claim",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ffc-ahwr-backoffice",
"version": "1.11.0",
"version": "1.12.0",
"description": "Back office of the health and welfare of your livestock",
"homepage": "https://github.com/DEFRA/ffc-ahwr-backoffice",
"main": "app/index.js",
Expand Down
38 changes: 0 additions & 38 deletions test/integration/narrow/routes/view-application.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const applications = require('../../../../app/api/applications')
const { administrator } = require('../../../../app/auth/permissions')
const viewApplicationData = require('.././../../data/view-applications.json')
const reference = 'VV-555A-FD4C'
const eligibleSpecies = require('../../../../app/constants/eligible-species')

jest.mock('../../../../app/api/applications')

Expand Down Expand Up @@ -67,7 +66,6 @@ describe('View Application test', () => {
expect($('tbody tr:nth-child(3) td:nth-child(3)').text()).toContain('At least 21')
expect($('tbody tr:nth-child(4) td:nth-child(2)').text()).toContain('T&Cs agreed?')
expect($('tbody tr:nth-child(4) td:nth-child(3)').text()).toContain('Yes')
expect($('#vet-review').text()).toContain('Not yet reviewed')
expect($('#claim').text()).toContain('Not yet able to claim')
expect($('#payment').text()).toContain('Not yet paid')
expectPhaseBanner.ok($)
Expand Down Expand Up @@ -95,19 +93,6 @@ describe('View Application test', () => {
expect($('.govuk-summary-list__key').eq(2).text()).toMatch('Email address:')
expect($('.govuk-summary-list__value').eq(2).text()).toMatch('[email protected]')

expect($('#vet-review').text()).toContain('Data inputted')
expect($('tbody:nth-child(2) tr:nth-child(1) td:nth-child(2)').text()).toContain('Review date')
expect($('tbody:nth-child(2) tr:nth-child(1) td:nth-child(3)').text()).toContain('06/06/2022')
expect($('tbody:nth-child(2) tr:nth-child(2) td:nth-child(2)').text()).toContain(eligibleSpecies.sheep)
expect($('tbody:nth-child(2) tr:nth-child(2) td:nth-child(3)').text()).toContain('Yes')
expect($('tbody:nth-child(2) tr:nth-child(3) td:nth-child(2)').text()).toContain('Worms in sheep?')
expect($('tbody:nth-child(2) tr:nth-child(3) td:nth-child(3)').text()).toContain('Yes')
expect($('tbody:nth-child(2) tr:nth-child(4) td:nth-child(2)').text()).toContain('Percentage reduction in EPG?')
expect($('tbody:nth-child(2) tr:nth-child(4) td:nth-child(3)').text()).toContain('40')
expect($('tbody:nth-child(2) tr:nth-child(5) td:nth-child(2)').text()).toContain('Active chemical used in worming treatment')
expect($('tbody:nth-child(2) tr:nth-child(5) td:nth-child(3)').text()).toContain('LV')
expect($('tbody:nth-child(2) tr:nth-child(6) td:nth-child(2)').text()).toContain('Report given?')
expect($('tbody:nth-child(2) tr:nth-child(6) td:nth-child(3)').text()).toContain('Yes')
expect($('#claim').text()).toContain('Not yet able to claim')
expect($('#payment').text()).toContain('Not yet paid')
expectPhaseBanner.ok($)
Expand Down Expand Up @@ -135,15 +120,6 @@ describe('View Application test', () => {
expect($('.govuk-summary-list__key').eq(2).text()).toMatch('Email address:')
expect($('.govuk-summary-list__value').eq(2).text()).toMatch('[email protected]')

expect($('#vet-review').text()).toContain('Data inputted')
expect($('tbody:nth-child(2) tr:nth-child(1) td:nth-child(2)').text()).toContain('Review date')
expect($('tbody:nth-child(2) tr:nth-child(1) td:nth-child(3)').text()).toContain('06/06/2022')
expect($('tbody:nth-child(2) tr:nth-child(2) td:nth-child(2)').text()).toContain(eligibleSpecies.pigs)
expect($('tbody:nth-child(2) tr:nth-child(2) td:nth-child(3)').text()).toContain('Yes')
expect($('tbody:nth-child(2) tr:nth-child(3) td:nth-child(2)').text()).toContain('PRRS in herd?')
expect($('tbody:nth-child(2) tr:nth-child(3) td:nth-child(3)').text()).toContain('Yes')

expect($('#vet-review').text()).toContain('Data inputted')
expect($('#claim').text()).toContain('Selected for fraud check')
expect($('tbody:nth-child(2) tr:nth-child(1) td:nth-child(2)').text()).toContain('Details correct?')
expect($('tbody:nth-child(2) tr:nth-child(1) td:nth-child(3)').text()).toContain('Yes')
Expand Down Expand Up @@ -173,20 +149,6 @@ describe('View Application test', () => {
expect($('.govuk-summary-list__key').eq(2).text()).toMatch('Email address:')
expect($('.govuk-summary-list__value').eq(2).text()).toMatch('[email protected]')

expect($('#vet-review').text()).toContain('Data inputted')
expect($('tbody:nth-child(2) tr:nth-child(1) td:nth-child(2)').text()).toContain('Review date')
expect($('tbody:nth-child(2) tr:nth-child(1) td:nth-child(3)').text()).toContain('06/06/2022')
expect($('tbody:nth-child(2) tr:nth-child(2) td:nth-child(2)').text()).toContain(eligibleSpecies.beef)
expect($('tbody:nth-child(2) tr:nth-child(2) td:nth-child(3)').text()).toContain('Yes')
expect($('tbody:nth-child(2) tr:nth-child(3) td:nth-child(2)').text()).toContain('BVD in herd?')
expect($('tbody:nth-child(2) tr:nth-child(3) td:nth-child(3)').text()).toContain('Yes')
expect($('tbody:nth-child(2) tr:nth-child(4) td:nth-child(2)').text()).toContain('Species Vaccinated?')
expect($('tbody:nth-child(2) tr:nth-child(4) td:nth-child(3)').text()).toContain('Yes')
expect($('tbody:nth-child(2) tr:nth-child(5) td:nth-child(2)').text()).toContain('Last Vaccinated?')
expect($('tbody:nth-child(2) tr:nth-child(5) td:nth-child(3)').text()).toContain('6-2008')
expect($('tbody:nth-child(2) tr:nth-child(6) td:nth-child(2)').text()).toContain('Vaccination up to date?')
expect($('tbody:nth-child(2) tr:nth-child(6) td:nth-child(3)').text()).toContain('No')

expect($('#claim').text()).toContain('Selected for fraud check')
expect($('#payment').text()).toContain('Payment information')
expect($('tbody:nth-child(2) tr:nth-child(1) td:nth-child(2)').text()).toContain('G00 - Gross value of claim')
Expand Down