+ ]);
+ // Let's try a key that doesn't have any labels
+ const tagValues2 = Vocabulary.getTagValues('automation', vocabulary);
+ expect(tagValues2).toEqual([
+ {id: "results", label: "results"},
+ {id: "upload", label: "upload"},
+ ]);
+ });
+
+ it('returns the preferred tag values for a given key', () => {
+ const preferredTagValues = Vocabulary.getPreferredTagValues('IDKEYSIZES', vocabulary);
+ // Alphabetically ordered by label
+ expect(preferredTagValues).toEqual([
+ {id: "IDVALSIZES4", label: "IDVALSIZES4", synonyms: []},
+ {id: "IDVALSIZES3", label: "Large", synonyms: []},
+ {id: "IDVALSIZES2", label: "Medium", synonyms: []},
+ {id: "IDVALSIZES1", label: "Small", synonyms: []},
+ ]);
+ // Let's try a key that doesn't have any labels
+ const preferredTagValues2 = Vocabulary.getPreferredTagValues('automation', vocabulary);
+ expect(preferredTagValues2).toEqual([
+ {id: "results", label: "results", synonyms: []},
+ {id: "upload", label: "upload", synonyms: []},
+ ]);
+ });
+
+ it('returns the preferred tag values with matching synonyms for a given key', () => {
+ const preferredTagValues = Vocabulary.getPreferredTagValues('IDKEYSIZES', vocabulary, 'litt');
+ // Alphabetically ordered by label
+ expect(preferredTagValues).toEqual([
+ {id: "IDVALSIZES4", label: "IDVALSIZES4", synonyms: []},
+ {id: "IDVALSIZES3", label: "Large", synonyms: []},
+ {id: "IDVALSIZES2", label: "Medium", synonyms: []},
+ {id: "IDVALSIZES1", label: "Small", synonyms: ["Little"]},