mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-20 04:20:38 +09:00
24 lines
882 B
TypeScript
24 lines
882 B
TypeScript
|
|
import { describe, expect, it } from "vitest";
|
||
|
|
import {
|
||
|
|
applyCompanyPrefix,
|
||
|
|
extractCompanyPrefixFromPath,
|
||
|
|
isBoardPathWithoutPrefix,
|
||
|
|
toCompanyRelativePath,
|
||
|
|
} from "./company-routes";
|
||
|
|
|
||
|
|
describe("company routes", () => {
|
||
|
|
it("treats execution workspace paths as board routes that need a company prefix", () => {
|
||
|
|
expect(isBoardPathWithoutPrefix("/execution-workspaces/workspace-123")).toBe(true);
|
||
|
|
expect(extractCompanyPrefixFromPath("/execution-workspaces/workspace-123")).toBeNull();
|
||
|
|
expect(applyCompanyPrefix("/execution-workspaces/workspace-123", "PAP")).toBe(
|
||
|
|
"/PAP/execution-workspaces/workspace-123",
|
||
|
|
);
|
||
|
|
});
|
||
|
|
|
||
|
|
it("normalizes prefixed execution workspace paths back to company-relative paths", () => {
|
||
|
|
expect(toCompanyRelativePath("/PAP/execution-workspaces/workspace-123")).toBe(
|
||
|
|
"/execution-workspaces/workspace-123",
|
||
|
|
);
|
||
|
|
});
|
||
|
|
});
|