Release Healer Man 0.1.5
This commit is contained in:
@@ -53,6 +53,37 @@ test("serves the game and authenticated cloud-save API", async () => {
|
||||
});
|
||||
assert.equal(saved.status, 200);
|
||||
assert.equal((await saved.json()).revision, 1);
|
||||
|
||||
const publicConfig = await fetch(`${origin}/api/manastorm-config`);
|
||||
assert.equal(publicConfig.status, 200);
|
||||
assert.equal((await publicConfig.json()).revision, 0);
|
||||
|
||||
const denied = await fetch(`${origin}/api/gm/manastorm-config`, {
|
||||
method: "PUT",
|
||||
headers: { "Content-Type": "application/json", Authorization: `Bearer ${auth.token}` },
|
||||
body: JSON.stringify({ expectedRevision: 0, config: { schemaVersion: 1 } }),
|
||||
});
|
||||
assert.equal(denied.status, 403);
|
||||
|
||||
const gmRegistration = await fetch(`${origin}/api/auth/register`, {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ username: "Phenom", password: "storm-admin" }),
|
||||
});
|
||||
assert.equal(gmRegistration.status, 201);
|
||||
const gmAuth = await gmRegistration.json();
|
||||
assert.deepEqual(gmAuth.account.roles, ["gm"]);
|
||||
const current = await (await fetch(`${origin}/api/manastorm-config`)).json();
|
||||
const published = await fetch(`${origin}/api/gm/manastorm-config`, {
|
||||
method: "PUT",
|
||||
headers: { "Content-Type": "application/json", Authorization: `Bearer ${gmAuth.token}` },
|
||||
body: JSON.stringify({
|
||||
expectedRevision: current.revision,
|
||||
config: { ...current.config, global: { ...current.config.global, chaoticLinkEnabled: false } },
|
||||
}),
|
||||
});
|
||||
assert.equal(published.status, 200);
|
||||
assert.equal((await published.json()).config.global.chaoticLinkEnabled, false);
|
||||
} finally {
|
||||
await new Promise((resolve) => runtime.server.close(resolve));
|
||||
rmSync(directory, { recursive: true, force: true });
|
||||
|
||||
Reference in New Issue
Block a user