From 3dfee189187254dfb6025c119146a8742dc5c389 Mon Sep 17 00:00:00 2001 From: Alan Cruikshanks Date: Thu, 4 Apr 2024 17:01:25 +0100 Subject: [PATCH] Correct test and demonstrate possible scenario The test wasn't actually testing for a non-match before because we were passing in a reference that would find matches. --- .../data/deduplicate/de-duplicate-licence.service.test.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/services/data/deduplicate/de-duplicate-licence.service.test.js b/test/services/data/deduplicate/de-duplicate-licence.service.test.js index 986fd22290..e20cf4422b 100644 --- a/test/services/data/deduplicate/de-duplicate-licence.service.test.js +++ b/test/services/data/deduplicate/de-duplicate-licence.service.test.js @@ -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) => {