// SPELLCHECK IN, in a browser (client/spellDicts.ts, shared/spellKnown.ts). // // The owner, on the dictionaries row: "for me it doesn't even show options I // think? It just shows toggles." The row is one multi-select now, and what // it offers is what the device can honestly check. In a browser — no app // around the page — that is the four line languages the editor stamps, // NONE checked until chosen (a page cannot see the browser's dictionaries), // each named in the chrome's language. The desktop half is its own file // (spell-dicts-desktop.test.ts): the module state is per process. import "../client/i18n/both.ts"; import assert from "node:assert/strict"; import { describe, it } from "node:test"; import { setLang } from "../client/i18n.ts"; import { DECLARABLE, dictionaryName, setBrowserDictionaries, spellOffer, storedDictionaries } from "../client/spellDicts.ts"; import { spellcheckKnown } from "../shared/spellKnown.ts"; const store = new Map(); Object.defineProperty(globalThis, "localStorage", { configurable: true, value: { getItem: (k: string) => store.get(k) ?? null, setItem: (k: string, v: string) => void store.set(k, v), removeItem: (k: string) => void store.delete(k), }, }); const heard: unknown[] = []; Object.defineProperty(globalThis, "window", { configurable: true, value: { dispatchEvent: (e: CustomEvent) => heard.push(e.detail) }, }); /** THE REGRESSION: no chip without a name, in either chrome. A chip's words * are its accessible name (it is a