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

Add 'currentVersion' modifier to LicenceModel #1133

Merged
merged 13 commits into from
Jun 24, 2024
Prev Previous commit
Next Next commit
Fix licence summary service test
We also remove some. But we didn't really need to include them as whether a licence has a licence holder or not is something that is fetched by the Fetch service and determined in the presenter.

Those are better placed to do the testing.
Cruikshanks committed Jun 21, 2024
commit 32ae09995a684ba183f615fbf28465c903823a82
33 changes: 2 additions & 31 deletions test/services/licences/view-licence-summary.service.test.js
Original file line number Diff line number Diff line change
@@ -74,34 +74,6 @@ describe('View Licence service summary', () => {
})
})
})

describe('and it does not have a licence holder', () => {
beforeEach(() => {
fetchLicenceResult = _testLicence()
fetchLicenceResult.licenceHolder = null
Sinon.stub(FetchLicenceSummaryService, 'go').resolves(fetchLicenceResult)
})

it('will return unregistered licence for use in the licence summary page', async () => {
const result = await ViewLicenceSummaryService.go(testId)

expect(result.licenceHolder).to.equal('Unregistered licence')
})
})

describe('and it does have a licence holder', () => {
beforeEach(() => {
fetchLicenceResult = _testLicence()
fetchLicenceResult.licenceHolder = 'Test Company'
Sinon.stub(FetchLicenceSummaryService, 'go').resolves(fetchLicenceResult)
})

it('will return the licence holder for use in the licence summary page', async () => {
const result = await ViewLicenceSummaryService.go(testId)

expect(result.licenceHolder).to.equal('Test Company')
})
})
})
})

@@ -140,8 +112,7 @@ function _testLicence () {
label: 'MEVAGISSEY FIRE STATION'
}
}],
licenceDocument: {},
licenceDocumentHeader: { id: '28665d16-eba3-4c9a-aa55-7ab671b0c4fb' },
licenceHolder: null
licenceDocument: null,
licenceDocumentHeader: { id: '28665d16-eba3-4c9a-aa55-7ab671b0c4fb' }
})
}