-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into DDFBRA-201-go-anonym-og-indlogget-bruger-kan…
…-prove-lydbog
- Loading branch information
Showing
41 changed files
with
491 additions
and
203 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
NEXT_PUBLIC_GRAPHQL_SCHEMA_ENDPOINT_DPL_CMS=http://dapple-cms.docker/graphql | ||
NEXT_PUBLIC_GRAPHQL_BASIC_TOKEN_DPL_CMS=Z3JhcGhxbF9jb25zdW1lcjp0ZXN0 | ||
|
||
NEXT_PUBLIC_GRAPHQL_SCHEMA_ENDPOINT_FBI=https://temp.fbi-api.dbc.dk/ereolgo/graphql | ||
// WILL BE REPLACED WITH DYNAMIC TOKEN | ||
NEXT_PUBLIC_LIBRARY_TOKEN=XXX | ||
|
||
UNILOGIN_SESSION_SECRET=XXX | ||
UNILOGIN_API_URL=https://et-broker.unilogin.dk | ||
UNILOGIN_WELKNOWN_URL=https://et-broker.unilogin.dk/auth/realms/broker/.well-known/openid-configuration | ||
UNILOGIN_CLIENT_ID=XXX | ||
UNILOGIN_CLIENT_SECRET=XXXX | ||
NEXT_PUBLIC_APP_URL=http://localhost:3000 | ||
UNILOGIN_CLIENT_ID=https://stg.ereolengo.itkdev.dk/ | ||
UNILOGIN_CLIENT_SECRET=XXX | ||
UNILOGIN_SESSION_SECRET=XXX | ||
|
||
NEXT_PUBLIC_APP_URL=https://localhost:3000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
NEXT_PUBLIC_GRAPHQL_SCHEMA_ENDPOINT_DPL_CMS=http://dapple-cms.docker/graphql | ||
NEXT_PUBLIC_GRAPHQL_BASIC_TOKEN_DPL_CMS=Z3JhcGhxbF9jb25zdW1lcjp0ZXN0 | ||
|
||
NEXT_PUBLIC_GRAPHQL_SCHEMA_ENDPOINT_FBI=https://temp.fbi-api.dbc.dk/ereolgo/graphql | ||
// WILL BE REPLACED WITH DYNAMIC TOKEN | ||
NEXT_PUBLIC_LIBRARY_TOKEN=XXX | ||
|
||
UNILOGIN_SESSION_SECRET=XXX | ||
UNILOGIN_API_URL=https://et-broker.unilogin.dk | ||
UNILOGIN_WELKNOWN_URL=https://et-broker.unilogin.dk/auth/realms/broker/.well-known/openid-configuration | ||
UNILOGIN_CLIENT_ID=XXX | ||
UNILOGIN_CLIENT_SECRET=XXXX | ||
UNILOGIN_CLIENT_ID=https://stg.ereolengo.itkdev.dk/ | ||
UNILOGIN_CLIENT_SECRET=XXX | ||
UNILOGIN_SESSION_SECRET=XXX | ||
|
||
NEXT_PUBLIC_APP_URL=https://hellboy.the-movie.com | ||
LAGOON_AUTOGENERATED_ROUTES=https://nginx.acme.com,https://node.acme.com,https://varnish.acme.com | ||
UNILOGIN_WELLKNOWN_URL=https://hi-i-am-well-known-url.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,31 @@ | ||
import { renderHook, waitFor } from "@testing-library/react" | ||
import { describe } from "node:test" | ||
import { expect, test } from "vitest" | ||
|
||
import goConfig from "@/lib/config/config" | ||
import MissingConfigurationError from "@/lib/config/errors/MissingConfigurationError" | ||
import goConfig from "@/lib/config/goConfig" | ||
import useGoConfig from "@/lib/config/useGoConfig" | ||
|
||
test("That an error is thrown if we ask for unknown config", async () => { | ||
// @ts-ignore | ||
expect(() => goConfig("unknown.thingy")).toThrowError(MissingConfigurationError) | ||
}) | ||
describe("Config test suite", () => { | ||
test("That an error is thrown if we ask for unknown config", async () => { | ||
// @ts-ignore | ||
expect(() => goConfig("unknown.thingy")).toThrowError(MissingConfigurationError) | ||
}) | ||
|
||
test("That the env variable NEXT_PUBLIC_APP_URL has precedence over LAGOON_AUTOGENERATED_ROUTES", async () => { | ||
const appUrl = goConfig("app.url") | ||
expect(appUrl).toBe("https://hellboy.the-movie.com") | ||
}) | ||
|
||
test("That the client hook returns configuration as expected", async () => { | ||
const { result } = renderHook(() => | ||
useGoConfig(["service.unilogin.wellknown.url", "search.item.limit"]) | ||
) | ||
|
||
test("That the env variable NEXT_PUBLIC_APP_URL has precedence over LAGOON_AUTOGENERATED_ROUTES", async () => { | ||
const appUrl = goConfig("app.url") | ||
expect(appUrl).toBe("https://hellboy.the-movie.com") | ||
await waitFor(() => {}) | ||
expect(result.current).toEqual({ | ||
"search.item.limit": 12, | ||
"service.unilogin.wellknown.url": "https://hi-i-am-well-known-url.com", | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,26 @@ | ||
import { expect, test } from "vitest" | ||
|
||
import goConfig from "@/lib/config/config" | ||
|
||
import { resolveUrl } from "../lib/helpers/helper.routes" | ||
|
||
test("That resolveUrl can return a work url", async () => { | ||
const workUrl = resolveUrl({ routeParams: { work: "work", wid: 123 } }) | ||
expect(workUrl).toBe("/work/123") | ||
const appUrl = goConfig("app.url") | ||
expect(workUrl).toBe(`${appUrl}/work/123`) | ||
}) | ||
|
||
test("That resolveUrl can return a work url with a manifestation type", async () => { | ||
const workUrl = resolveUrl({ | ||
routeParams: { work: "work", wid: 123 }, | ||
queryParams: { audio: "true" }, | ||
}) | ||
expect(workUrl).toBe("/work/123?audio=true") | ||
const appUrl = goConfig("app.url") | ||
expect(workUrl).toBe(`${appUrl}/work/123?audio=true`) | ||
}) | ||
|
||
test("That resolveUrl can return a search url", async () => { | ||
const workUrl = resolveUrl({ routeParams: { search: "search" }, queryParams: { q: "test" } }) | ||
expect(workUrl).toBe("/search?q=test") | ||
const appUrl = goConfig("app.url") | ||
expect(workUrl).toBe(`${appUrl}/search?q=test`) | ||
}) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.