Skip to content

Commit

Permalink
remove: vet tab (#40)
Browse files Browse the repository at this point in the history
* remove: vet tab

* bump: version

* fix: linting, remove vet tabs unit tests
  • Loading branch information
shivanshuit914 authored Oct 14, 2022
1 parent f72f792 commit f5d068e
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 57 deletions.
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

0 comments on commit f5d068e

Please sign in to comment.