Skip to content

Commit

Permalink
fix: failing ci-checks
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasGross committed Nov 22, 2024
1 parent 6c231ca commit f92c02b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions __tests__/url.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,19 @@ import { expect, test } from "vitest"
import { resolveUrl } from "../lib/helpers/helper.routes"

test("That resolveUrl can return a work url", async () => {
const workUrl = resolveUrl({ type: "work", routeParams: { wid: 123 } })
const workUrl = resolveUrl({ routeParams: { work: "work", wid: 123 } })
expect(workUrl).toBe("/work/123")
})

test("That resolveUrl can return a work url with a manifestation type", async () => {
const workUrl = resolveUrl({
type: "work",
routeParams: { wid: 123 },
routeParams: { work: "work", wid: 123 },
queryParams: { audio: "true" },
})
expect(workUrl).toBe("/work/123?audio=true")
})

test("That resolveUrl can return a search url", async () => {
const workUrl = resolveUrl({ type: "search", queryParams: { q: "test" } })
const workUrl = resolveUrl({ routeParams: { search: "search" }, queryParams: { q: "test" } })
expect(workUrl).toBe("/search?q=test")
})
2 changes: 1 addition & 1 deletion components/pages/workPageLayout/WorkPageLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function WorkPageLayout({ wid }: { wid: string }) {
return (
<div>
{identifier && (
<Button asChild>
<Button ariaLabel="Prøv ebog" asChild>
<SmartLink linkType="external" href={url}>
Read
</SmartLink>
Expand Down

0 comments on commit f92c02b

Please sign in to comment.