Skip to content

Commit

Permalink
Correct test and demonstrate possible scenario
Browse files Browse the repository at this point in the history
The test wasn't actually testing for a non-match before because we were passing in a reference that would find matches.
  • Loading branch information
Cruikshanks committed Apr 4, 2024
1 parent e9c36d6 commit 3dfee18
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,10 @@ describe('De-duplicate Licence service', () => {

describe('when there is no matching licence', () => {
it('removes no licences', async () => {
await DeDuplicateLicenceService.go(licenceRef)
// NOTE: We also pondered what happens if someone enters a reference that is invalid for other reasons like
// they put a space in the middle. We definitely have no licences with this kind of reference so it will be
// treated in the same way as a reference that matches no licences.
await DeDuplicateLicenceService.go('01/ 120')

const allLicences = await LicenceModel.query().select('id')
const allLicenceIds = allLicences.map((licence) => {
Expand Down

0 comments on commit 3dfee18

Please sign in to comment.