Skip to content

Commit

Permalink
Merge branch 'w2p-109964_fix-vocabulary-options-with-url-as-stored-va…
Browse files Browse the repository at this point in the history
…lue_contribute-7.0' into w2p-109964_fix-vocabulary-options-with-url-as-stored-value_contribute-main
  • Loading branch information
alexandrevryghem committed Dec 28, 2023
2 parents 92a10ce + 989b7f5 commit f4c8391
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions src/app/core/submission/vocabularies/vocabulary.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,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', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/submission/vocabularies/vocabulary.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export class VocabularyService {
getVocabularyEntriesByValue(value: string, exact: boolean, vocabularyOptions: VocabularyOptions, pageInfo: PageInfo): Observable<RemoteData<PaginatedList<VocabularyEntry>>> {
const options: VocabularyFindOptions = new VocabularyFindOptions(
null,
value,
encodeURIComponent(value),
exact,
null,
pageInfo.elementsPerPage,
Expand Down

0 comments on commit f4c8391

Please sign in to comment.