Skip to content

Commit

Permalink
Update unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
obulat committed Oct 5, 2023
1 parent 58e54b1 commit 96d3a42
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions frontend/test/unit/specs/stores/search-store.spec.js
Expand Up @@ -105,6 +105,21 @@ describe("Search Store", () => {
}
)

it.each`
type | tag | creator | source | expected
${IMAGE} | ${"cat"} | ${undefined} | ${"cat"} | ${"/image/tag/cat/"}
${AUDIO} | ${undefined} | ${"cat"} | ${"jamendo"} | ${"/audio/source/jamendo/creator/cat/"}
${IMAGE} | ${undefined} | ${undefined} | ${"flickr"} | ${"/image/source/flickr/"}
`(
"getCollectionPath returns $expected for $type, $tag, $creator, $source",
({ type, tag, creator, source, expected }) => {
const searchStore = useSearchStore()
searchStore.getCollectionPath({ type, tag, creator, source })

expect(searchStore.$nuxt.localePath).toHaveBeenCalledWith(expected)
}
)

/**
* For non-supported search types, the filters fall back to 'All content' filters.
* Number of displayed filters is one less than the number of mediaFilterKeys
Expand Down

0 comments on commit 96d3a42

Please sign in to comment.