mirror of
https://github.com/outline/outline.git
synced 2026-11-21 13:34:02 +03:00
* feat: add installation.info endpoint using DockerHub API * feat: UI use an server-side API to show version info * fix: review fixes * test: installation.info endpoint * feat: filtering pre-releases in installation.info endpoint * fix: change fetch to ApiClient usage for getting version info * Undo translation change --------- Co-authored-by: Tom Moor <tom.moor@gmail.com>
32 lines
911 B
TypeScript
32 lines
911 B
TypeScript
import { buildUser } from "@server/test/factories";
|
|
import { getTestServer } from "@server/test/support";
|
|
|
|
const server = getTestServer();
|
|
|
|
describe("installation.info", () => {
|
|
it("should require authentication", async () => {
|
|
const res = await server.post("/api/installation.info", {
|
|
body: {},
|
|
});
|
|
expect(res.status).toEqual(401);
|
|
});
|
|
|
|
it("should return installation information", async () => {
|
|
const user = await buildUser();
|
|
const res = await server.post("/api/installation.info", {
|
|
body: {
|
|
token: user.getJwtToken(),
|
|
},
|
|
});
|
|
|
|
const body = await res.json();
|
|
|
|
expect(res.status).toEqual(200);
|
|
expect(body.data).not.toBeFalsy();
|
|
expect(body.data.version).not.toBeFalsy();
|
|
expect(body.data.latestVersion).not.toBeFalsy();
|
|
expect(typeof body.data.versionsBehind).toBe("number");
|
|
expect(body.policies).not.toBeFalsy();
|
|
});
|
|
});
|