Skip to content

Commit

Permalink
fix(app): readjusted test for legibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Demwunz committed Apr 3, 2024
1 parent c37836b commit 6d5bdd5
Showing 1 changed file with 12 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ const { expect } = Code
// Thing under test
const CheckYourAnswersPresenter = require('../../../app/presenters/return-requirements/check-your-answers.presenter.js')

describe('Check Your Answers presenter - No Returns Required', () => {
describe.only('Check Your Answers presenter - No Returns Required', () => {
let session

beforeEach(() => {
session = {
data: {
id: 'f1288f6c-8503-4dc1-b114-75c408a14bd0',
licence: {
id: 'ea53bfc6-740d-46c5-9558-fc8cabfc6c1f',
licenceRef: '01/123',
licenceHolder: 'Astro Boy'
},
journey: 'no-returns-required',
reason: 'returns-exception',
journey: '',
reason: '',
startDate: '2008-02-08',
startDateDay: '08',
startDateMonth: '02',
Expand All @@ -32,8 +32,11 @@ describe('Check Your Answers presenter - No Returns Required', () => {
}
})

describe('when provided with a populated session', () => {
describe('when the no-returns-required journey was selected', () => {
it('correctly presents the data', () => {
session.data.journey = 'no-returns-required'
session.data.reason = 'returns-exception'

const result = CheckYourAnswersPresenter.go(session)

expect(result).to.equal({
Expand All @@ -44,29 +47,12 @@ describe('Check Your Answers presenter - No Returns Required', () => {
}, { skip: ['id'] })
})
})
})

describe('Check Your Answers presenter - Returns Required', () => {
let session

beforeEach(() => {
session = {
data: {
licence: {
currentVersionStartDate: '2008-02-08T00:00:00.000Z',
id: 'ea53bfc6-740d-46c5-9558-fc8cabfc6c1f',
licenceRef: '01/123',
licenceHolder: 'Astro Boy'
},
reason: 'major-change',
journey: 'returns-required',
startDateOptions: 'licenceStartDate'
}
}
})

describe('when provided with a populated session', () => {
describe('when the returns-required journey was selected', () => {
it('correctly presents the data', () => {
session.data.journey = 'returns-required'
session.data.reason = 'major-change'

const result = CheckYourAnswersPresenter.go(session)

expect(result).to.equal({
Expand Down

0 comments on commit 6d5bdd5

Please sign in to comment.