test(ui): address review nits on playground migration

Add the /ui/playground/ trailing-slash assertion for parity with the
api-reference case, and rename the mapping test so its name covers the
llm-playground entry it now also asserts.
This commit is contained in:
ryan-crabbe-berri 2026-06-08 14:06:04 -07:00
parent 363579f70f
commit c6f223cfcd

View file

@ -28,7 +28,7 @@ describe("migratedHref / legacyPageHref", () => {
expect(migratedHref("/api-reference")).toBe("/ui/api-reference");
});
it("maps both the api_ref id and the hyphenated alias to the api-reference route", async () => {
it("maps legacy page ids (and the hyphenated api-reference alias) to their route segments", async () => {
vi.doMock("@/components/networking", () => ({ serverRootPath: "/" }));
const { MIGRATED_PAGES } = await import("./migratedPages");
@ -51,6 +51,7 @@ describe("legacyKeyForPathname", () => {
expect(legacyKeyForPathname("/ui/api-reference")).toBe("api_ref");
expect(legacyKeyForPathname("/ui/api-reference/")).toBe("api_ref");
expect(legacyKeyForPathname("/ui/playground")).toBe("llm-playground");
expect(legacyKeyForPathname("/ui/playground/")).toBe("llm-playground");
});
it("returns null for a not-yet-migrated path", async () => {