From 989b7f592bdd17dedc5456a192cbf530de807398 Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Thu, 28 Dec 2023 16:36:55 +0100 Subject: [PATCH] 109728: Added test to check that getVocabularyEntriesByValue encodes its value --- .../vocabularies/vocabulary.service.spec.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/app/core/submission/vocabularies/vocabulary.service.spec.ts b/src/app/core/submission/vocabularies/vocabulary.service.spec.ts index 9f8bec307f2..f6fac9edb58 100644 --- a/src/app/core/submission/vocabularies/vocabulary.service.spec.ts +++ b/src/app/core/submission/vocabularies/vocabulary.service.spec.ts @@ -365,6 +365,18 @@ describe('VocabularyService', () => { }) })); }); + + it('should encode the value', () => { + scheduler.schedule(() => service.getVocabularyEntriesByValue('https://creativecommons.org/licenses/by-sa/4.0/', false, vocabularyOptions, pageInfo).subscribe()); + scheduler.flush(); + + expect(service.findVocabularyById).toHaveBeenCalledWith(vocabularyOptions.name, true, true, jasmine.objectContaining({ + findListOptions: jasmine.objectContaining({ + filter: 'https%3A%2F%2Fcreativecommons.org%2Flicenses%2Fby-sa%2F4.0%2F', + exact: false, + }) + })); + }); }); describe('getVocabularyEntryByValue', () => {