| 1 | import assert from "node:assert/strict"; |
| 2 | import { test } from "node:test"; |
| 3 | |
| 4 | import { CUSTOMIZE, CUSTOMIZE_SECTIONS, customizePath, sectionOfListing } from "./customize.ts"; |
| 5 | |
| 6 | test("every listing has a place in Customize", () => { |
| 7 | assert.equal(sectionOfListing("integration"), "connectors"); |
| 8 | assert.equal(sectionOfListing("connector"), "connectors"); |
| 9 | assert.equal(sectionOfListing("skill"), "skills"); |
| 10 | assert.equal(sectionOfListing("plugin"), "plugins"); |
| 11 | assert.equal(sectionOfListing("extension"), "plugins"); |
| 12 | for (const section of CUSTOMIZE_SECTIONS) assert.equal(CUSTOMIZE[section].id, section); |
| 13 | }); |
| 14 | |
| 15 | test("a section's site path names its workspace", () => { |
| 16 | assert.equal(customizePath("connectors", "acme"), "/acme/-/customize/connectors"); |
| 17 | assert.equal(customizePath("skills", "a b"), "/a%20b/-/customize/skills"); |
| 18 | assert.equal(customizePath("", "acme"), "/acme/-/customize"); |
| 19 | assert.equal(customizePath("plugins", "acme", "pdf@anthropic-agent-skills"), "/acme/-/customize/plugins/pdf@anthropic-agent-skills"); |
| 20 | }); |