// @vitest-environment jsdom // // E22 S5: a clicked control's label is logged only when it is the app's own copy — as its English // wording — so nothing a user wrote (a title, a tag, a channel name) can come out of the click log. import { describe, expect, it } from "vitest"; import { appCopyOf } from "./appCopy"; describe("appCopyOf", () => { it("finds app copy in either language and reads it in English, whatever the whitespace", () => { expect(appCopyOf("Turn on for 24 hours")).toBe("Turn on for 24 hours"); expect(appCopyOf(" Bekapcsolom\n 24 órára ")).toBe("Turn on for 24 hours"); }); it("a wording several keys share still names the wording, not one arbitrary key", () => { // "Diagnosztika" is both the Settings tab and the Configuration group. expect(appCopyOf("Diagnosztika")).toBe("Diagnostics"); }); it("finds nothing in what a user wrote, and never matches an interpolated string", () => { expect(appCopyOf("My holiday video 2024")).toBeNull(); expect(appCopyOf("")).toBeNull(); expect(appCopyOf(null)).toBeNull(); expect(appCopyOf("{{count}} events · newest first")).toBeNull(); }); });