Skip to content

Commit

Permalink
Merge pull request #83 from DEFRA/DSFAAP-608_remove-tests-section
Browse files Browse the repository at this point in the history
Dsfaap 608 remove tests section
  • Loading branch information
hughfdjackson authored Dec 18, 2024
2 parents 62fef30 + 9893f11 commit 98824ee
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 77 deletions.
14 changes: 0 additions & 14 deletions src/server/common/model/section/tests/tests.js

This file was deleted.

24 changes: 0 additions & 24 deletions src/server/common/model/section/tests/tests.test.js

This file was deleted.

19 changes: 2 additions & 17 deletions src/server/task-list/controller.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { OriginSection } from '../common/model/section/origin/origin.js'
import { DestinationSection } from '../common/model/section/destination/destination.js'
import { TestsSection } from '../common/model/section/tests/tests.js'
import { LicenceSection } from '../common/model/section/licence/licence.js'

const pageTitle = 'Your Bovine Tuberculosis (TB) movement licence application'
Expand All @@ -15,7 +14,6 @@ export const taskListGetController = {
handler(req, h) {
const origin = OriginSection.fromState(req.yar.get('origin'))
const destination = DestinationSection.fromState(req.yar.get('destination'))
const tests = TestsSection.fromState()
const licence = LicenceSection.fromState(req.yar.get('licence'))

const originValidity = origin.validate()
Expand All @@ -42,14 +40,6 @@ export const taskListGetController = {
isEnabled: isOriginValid
})

const testsGdsTask = buildGdsTaskItem({
title: 'Tests',
initialLink: '#',
summaryLink: '#',
isValid: tests.validate().isValid,
isEnabled: isOriginValid
})

const licenceGdsTask = buildGdsTaskItem({
title: 'Receiving the licence',
initialLink: '/receiving-the-licence/licence-enter-email-address',
Expand All @@ -58,14 +48,9 @@ export const taskListGetController = {
isEnabled: true
})

const gdsTasks = [
originGdsTask,
destinationGdsTask,
testsGdsTask,
licenceGdsTask
]
const gdsTasks = [originGdsTask, destinationGdsTask, licenceGdsTask]

const allTasks = [origin, destination, tests, licence]
const allTasks = [origin, destination, licence]
const incompleteTasks =
allTasks.length -
allTasks.filter((task) => {
Expand Down
1 change: 0 additions & 1 deletion src/server/task-list/controller.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ describe('#taskListController', () => {
expect(taskTitles).toEqual([
'Movement origin',
'Movement destination',
'Tests',
'Receiving the licence'
])
})
Expand Down
12 changes: 2 additions & 10 deletions user-journey-tests/page-objects/finalAnswersPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,12 @@ class FinalAnswersPage extends Page {
return $$(valueIdentifier)[3]
}

get testsValue() {
return $$(valueIdentifier)[4]
}

get receivingMethodValue() {
return $$(valueIdentifier)[5]
return $$(valueIdentifier)[4]
}

get emailValue() {
return $$(valueIdentifier)[6]
return $$(valueIdentifier)[5]
}

get onOffFarmChange() {
Expand All @@ -64,10 +60,6 @@ class FinalAnswersPage extends Page {
return $('[data-testid="destination-change-link"]')
}

get testsChange() {
return $('[data-testid="tests-change-link"]')
}

get receivingMethodChange() {
return $('[data-testid="licence-choice-change-link"]')
}
Expand Down
2 changes: 1 addition & 1 deletion user-journey-tests/specs/finalAnswers.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe('Check your final answers test', () => {
await licenceAnswersPage.selectContinue()
await taskListPage.verifyPageHeadingAndTitle()
await taskListPage.verifyStatus({
position: 4,
position: 3,
taskTitle: 'Receiving the licence',
expectedStatus: 'Completed'
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('Check your licence answers test', () => {
await licenceAnswersPage.selectContinue()
await taskListPage.verifyPageHeadingAndTitle()
await taskListPage.verifyStatus({
position: 4,
position: 3,
taskTitle: 'Receiving the licence',
expectedStatus: 'Completed'
})
Expand Down
15 changes: 6 additions & 9 deletions user-journey-tests/specs/taskList.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,14 @@ describe('Task list page test', () => {
taskTitle: 'Movement destination',
expectedStatus: 'Cannot start yet'
},
{ position: 3, taskTitle: 'Test', expectedStatus: 'Cannot start yet' },
{
position: 4,
position: 3,
taskTitle: 'Receiving the licence',
expectedStatus: 'Incomplete'
}
])

expect(await taskListPage.getTaskToCompleteCount()).toBe('4 out of 4')
expect(await taskListPage.getTaskToCompleteCount()).toBe('3 out of 3')
})

it('Should link to movement origin first question before an application has been started', async () => {
Expand All @@ -60,15 +59,14 @@ describe('Task list page test', () => {
taskTitle: 'Movement destination',
expectedStatus: 'Incomplete'
},
{ position: 3, taskTitle: 'Test', expectedStatus: 'Incomplete' },
{
position: 4,
position: 3,
taskTitle: 'Receiving the licence',
expectedStatus: 'Incomplete'
}
])

expect(await taskListPage.getTaskToCompleteCount()).toBe('3 out of 4')
expect(await taskListPage.getTaskToCompleteCount()).toBe('2 out of 3')

await taskListPage.selectMovementOrigin()
await checkAnswersPage.verifyPageHeadingAndTitle(
Expand Down Expand Up @@ -97,15 +95,14 @@ describe('Task list page test', () => {
taskTitle: 'Movement destination',
expectedStatus: 'Cannot start yet'
},
{ position: 3, taskTitle: 'Test', expectedStatus: 'Cannot start yet' },
{
position: 4,
position: 3,
taskTitle: 'Receiving the licence',
expectedStatus: 'Completed'
}
])

expect(await taskListPage.getTaskToCompleteCount()).toBe('3 out of 4')
expect(await taskListPage.getTaskToCompleteCount()).toBe('2 out of 3')

await taskListPage.selectReceiveTheLicence()
await licenceAnswersPage.verifyPageHeadingAndTitle()
Expand Down

0 comments on commit 98824ee

Please sign in to comment.