kdjskdjsk
This commit is contained in:
@@ -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" } },
|
||||
|
||||
Reference in New Issue
Block a user