| 1 | import assert from "node:assert/strict"; |
| 2 | import { readFileSync } from "node:fs"; |
| 3 | import { test } from "node:test"; |
| 4 | |
| 5 | import { tabsFor } from "./project-nav.ts"; |
| 6 | import { ROADMAP } from "./roadmap.ts"; |
| 7 | |
| 8 | test("code is not docs: a project never gets a Docs tab", () => { |
| 9 | // Docs is its own workspace mode, filtered by project there. |
| 10 | assert.equal(ROADMAP.some((item) => item.section !== "Workspace" && /docs/i.test(item.key)), false); |
| 11 | const nav = readFileSync(new URL("./project-nav.ts", import.meta.url), "utf8"); |
| 12 | assert.doesNotMatch(nav, /label: "Docs"|soon\("Code"\)/); |
| 13 | }); |
| 14 | |
| 15 | |
| 16 | test("build configuration is discoverable under deployments only with integration access", () => { |
| 17 | const writer = tabsFor("settings/deployments", true, { manage_integrations: true }); |
| 18 | assert.ok(writer?.some((tab) => tab.path === "deployments")); |
| 19 | assert.ok(writer?.some((tab) => tab.path === "settings/deployments")); |
| 20 | assert.equal(tabsFor("deployments", false), null); |
| 21 | assert.equal(tabsFor("deployments", true, { manage_integrations: false }), null); |
| 22 | }); |
| 23 | |
| 24 | test("Storage is planned while implemented environments are no longer marked Soon", () => { |
| 25 | assert.equal(ROADMAP.find((item) => item.key === "storage")?.section, "Project"); |
| 26 | assert.equal(ROADMAP.some((item) => item.key === "environments"), false); |
| 27 | }); |