Files
plainleaf/plugs/configuration-manager/ui/components/libraries_tab.test.ts
T
wushenghuaandCodex fdd51f01a2
CI / config (push) Canceled after 0s
CI / test-frontend (push) Canceled after 0s
CI / test-rust (push) Canceled after 0s
CI / test-e2e (push) Canceled after 0s
CI / test-e2e-release (push) Canceled after 0s
CI / build (push) Canceled after 0s
CI / release (push) Canceled after 0s
CI / docker (push) Canceled after 0s
CI / docker-website (push) Canceled after 0s
feat: localize settings and smooth theme switching
Add a persistent system-content switch, translate the extension manager,
and apply theme changes in place without reloading the browser UI.

Co-Authored-By: Codex <noreply@anthropic.com>
2026-08-12 17:42:44 +08:00

22 lines
838 B
TypeScript

import { expect, test } from "vitest";
import {
libraryDescriptionZhCN,
libraryDisplayName,
} from "./libraries_tab.tsx";
test("uses Chinese labels without changing unknown extension names", () => {
expect(libraryDisplayName("Library/Std/Config")).toBe("扩展库 / 内置 / 配置");
expect(libraryDisplayName("Repositories/Std")).toBe("扩展仓库 / 内置");
expect(libraryDisplayName("PDF Viewer")).toBe("PDF 阅读器");
expect(libraryDisplayName("Author Custom Plug")).toBe("Author Custom Plug");
});
test("provides Chinese descriptions for recommended extensions", () => {
expect(libraryDescriptionZhCN("Markdown Prettify", "English fallback")).toBe(
"自动整理并统一 Markdown 排版格式。",
);
expect(libraryDescriptionZhCN("Author Custom Plug", "Author text")).toBe(
"Author text",
);
});