Skip to content

Commit

Permalink
Test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jesperengstrom committed Dec 17, 2024
1 parent dc204c3 commit d2da455
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lxl-web/src/lib/utils/getLabelsFromMapping.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import type { DisplayMapping } from '$lib/types/search';

describe('getLabelsFromMapping', () => {
it('it returns labels when supplied with page mappings', () => {
const labels = getLabelsFromMapping('genreForm', 'saogf:Romaner', pageMapping, null);
const labels = getLabelsFromMapping('genreForm', 'saogf:Romaner', pageMapping, undefined);
expect(labels.keyLabel).toBe('Genre/form');
expect(labels.valueLabel).toBe('Romaner');
});

it('it returns labels when supplied with suggest mappings', () => {
const labels = getLabelsFromMapping('genreForm', 'saogf:Romaner', null, suggestMapping);
const labels = getLabelsFromMapping('genreForm', 'saogf:Romaner', undefined, suggestMapping);
expect(labels.keyLabel).toBe('Genre/form');
expect(labels.valueLabel).toBe('Romaner');
});
Expand Down Expand Up @@ -46,12 +46,12 @@ describe('getLabelsFromMapping', () => {
});

it('does not return a removelink when using suggest mappings', () => {
const labels = getLabelsFromMapping('genreForm', 'saogf:Romaner', null, suggestMapping);
const labels = getLabelsFromMapping('genreForm', 'saogf:Romaner', undefined, suggestMapping);
expect(labels.removeLink).toBe(undefined);
});

it('returns a removelink when using page mappings', () => {
const labels = getLabelsFromMapping('genreForm', 'saogf:Romaner', pageMapping, null);
const labels = getLabelsFromMapping('genreForm', 'saogf:Romaner', pageMapping, undefined);
expect(labels.removeLink).toBe('/find?_i=sommar&_q=sommar+%C3%85R:2023&_limit=20&_spell=true');
});
});
Expand Down

0 comments on commit d2da455

Please sign in to comment.