test: 验证运行时工作空间公开契约
This commit is contained in:
1 parent
f9ca5b1fea
commit
53ee034db8
3 files changed
+14
No files matched your search
@@ -147,6 +147,7 @@ export class PublicWorkspaceController {
|
||||
config: this.jsonObject(module.config),
|
||||
source:
|
||||
module.source === "custom" ? "custom" : module.source === "template" ? "template" : "core",
|
||||
schemaVersion: "1.0",
|
||||
}));
|
||||
const runtimeOfferings: RuntimeOffering[] = offerings.map((item) => {
|
||||
const config = this.jsonObject(item.config);
|
||||
|
||||
@@ -46,6 +46,17 @@ test("health and public content are available without authentication", async ()
|
||||
assert.ok(JSON.parse(services.body).length >= 3);
|
||||
const removedServicesRoute = await request("/public/services");
|
||||
assert.equal(removedServicesRoute.statusCode, 404);
|
||||
|
||||
const workspace = await request("/public/workspace");
|
||||
assert.equal(workspace.statusCode, 200);
|
||||
const runtime = JSON.parse(workspace.body);
|
||||
assert.equal(runtime.schemaVersion, "1.0.0");
|
||||
assert.ok(Array.isArray(runtime.navigation.tabs));
|
||||
assert.ok(Array.isArray(runtime.modules));
|
||||
assert.ok(Array.isArray(runtime.offerings));
|
||||
assert.ok(Array.isArray(runtime.inquiryForms));
|
||||
assert.ok(Array.isArray(runtime.capabilities));
|
||||
assert.ok(runtime.theme.colors.background);
|
||||
});
|
||||
|
||||
test("admin can install a template and public workspace exposes enabled configuration", async () => {
|
||||
|
||||
Reference in new issue
Block a user