kdjskdjsk
Some checks failed
Test / test (push) Failing after 3s
Build and Deploy Nuxt / build (push) Failing after 48s

This commit is contained in:
2026-10-19 19:23:58 +02:00
parent 6854a650fb
commit 18d3805b60
3 changed files with 32 additions and 11 deletions

View File

@@ -35,6 +35,7 @@ function makeStubWorld({
linkCode = "",
linkUrl = "",
answers = {},
endpoint = "http://backend.test:5000",
} = {}) {
const state = {
hooks: new Map(),
@@ -48,7 +49,7 @@ function makeStubWorld({
syncToken,
linkCode,
linkUrl,
dragonrollApiUrl: "http://backend.test:5000",
dragonrollApiUrl: endpoint,
};
const sandbox = {
@@ -174,6 +175,17 @@ test("an unpaired world asks Dragonroll for a sign-up link and shows it", async
assert.equal(world.setting("linkCode"), "link-code-1", "the code behind the link is kept to ask with");
});
test("a local Dragonroll endpoint keeps the API path the backend mounts", async () => {
const world = await makeStubWorld({
syncToken: "",
endpoint: "http://localhost:5000",
answers: { "link/start": { status: "ok", code: "link-code-1", linkUrl: SIGN_UP_LINK } },
}).start();
assert.equal(world.linkStarts()[0].href, "http://localhost:5000/api/link/start",
"a local server is asked under /api like any other");
});
test("a world that holds a token neither asks for a link nor waits on one", async () => {
const world = await makeStubWorld({
answers: { "foundry/sync/status": { status: "ok", campaign: LINKED_CAMPAIGN, worldId: "world-1" } },