mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
Shared Claude Code translation pipeline (scripts/i18n, no API key) plus Astro/VitePress/Scalar i18n wiring. Landing and API reference translated into all 20 languages; docs i18n wiring + English source anchors. The translated docs markdown (apps/docs/<locale>/**, 3,620 files) follows in a companion PR because it exceeds GitHub's per-PR CI file limit.
27 lines
906 B
TypeScript
27 lines
906 B
TypeScript
// tests/unit/scripts/i18n/slugify.test.ts
|
|
import { describe, expect, it } from "vitest";
|
|
import { slugify } from "../../../../scripts/i18n/lib/slugify.mjs";
|
|
|
|
describe("slugify (VitePress/mdit-vue parity)", () => {
|
|
it("lowercases and dashes spaces", () => {
|
|
expect(slugify("Getting Started")).toBe("getting-started");
|
|
});
|
|
|
|
it("collapses punctuation runs to a single dash and trims", () => {
|
|
expect(slugify("File Processing (241 Tools)")).toBe("file-processing-241-tools");
|
|
expect(slugify("REST API & API Keys")).toBe("rest-api-api-keys");
|
|
});
|
|
|
|
it("strips combining marks via NFKD", () => {
|
|
expect(slugify("Café Details")).toBe("cafe-details");
|
|
});
|
|
|
|
it("prefixes a leading digit with underscore", () => {
|
|
expect(slugify("3 Steps")).toBe("_3-steps");
|
|
});
|
|
|
|
it("handles a plain two-word heading", () => {
|
|
expect(slugify("Quick Start")).toBe("quick-start");
|
|
});
|
|
});
|