Files
paseo/packages/website/src/plugin-docs-navigation.test.ts
T
Mohamed Boudra 047f40e623 Install npm plugins and review source updates (#4975)
* feat(plugins): unify source installation and simplify plugin settings

* feat(plugins): install npm sources and review CLI updates

Treat install selectors as one-time choices. Keep source identity separate from the installed revision, and resolve ordinary updates from the current upstream default. npm only acquires directories; plugin loading remains independent of npm.

* fix(plugins): preserve CLI diagnostics and exercise reviewed updates

Move new source capability coverage to real browser journeys. Update the requirements regression to exercise preview and apply, and preserve the existing duplicate-selector diagnostic across positional option scopes.

* test(plugins): remove unused pending helper

* test(plugins): pack registry fixtures with the Windows command runner

* test(plugins): assert failed client contribution setup

* docs(plugins): consolidate guides and document npm publishing

* docs(plugins): introduce publishing choices before npm instructions

* test(plugins): own browser journey cleanup in a fixture

* feat(plugins): prepare scaffolded packages for publishing
2026-09-17 10:22:20 +02:00

42 lines
1.8 KiB
TypeScript

import { describe, expect, it } from "vitest";
import { buildDocsNavTree, getDoc, getDocs, getLegacyDocsRedirect } from "./docs";
describe("plugin documentation", () => {
it("groups current guides by task without version navigation", () => {
const plugins = buildDocsNavTree(getDocs()).find(
(node) => node.type === "category" && node.label === "Plugins",
);
expect(plugins).toMatchObject({
type: "category",
children: [
{ type: "page", label: "Quickstart", href: "/docs/plugins" },
{ type: "page", label: "Publishing", href: "/docs/plugins/publishing" },
{ type: "page", label: "Provider plugins", href: "/docs/plugins/providers" },
{ type: "page", label: "Migration", href: "/docs/plugins/migration" },
{ type: "page", label: "Reference", href: "/docs/plugins/reference" },
],
});
});
it.each(["v0.7", "v0.8"])("redirects %s links to existing current pages", (version) => {
for (const page of ["", "/index", "/reference", "/providers", "/migration"]) {
const target = `/docs/plugins${page === "/index" ? "" : page}`;
expect(getDoc(target.slice("/docs/".length))).toBeDefined();
for (const extension of ["", ".md"]) {
const source = `/docs/plugins/${version}${page}${extension}`;
expect(getLegacyDocsRedirect(source)).toBe(`${target}${extension}`);
expect(getLegacyDocsRedirect(`${source}/`)).toBe(`${target}${extension}`);
}
}
});
it("serves canonical pages without redirect loops", () => {
for (const page of ["", "/publishing", "/reference", "/providers", "/migration"]) {
expect(getLegacyDocsRedirect(`/docs/plugins${page}`)).toBeUndefined();
expect(getLegacyDocsRedirect(`/docs/plugins${page}.md`)).toBeUndefined();
}
expect(getLegacyDocsRedirect("/docs/plugins/v0.8/unknown")).toBeUndefined();
});
});