conversation-session-dynamic-workflow-gray-always-on-english-dark.test.ts 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475
  1. import { TID_CHAT_WORKFLOW_RUN_DIGEST } from "@zcode/shared";
  2. import { clearAppData, pinE2ELocale } from "#e2e/helpers/desktop-app";
  3. import { releaseControlledReplay } from "#e2e/helpers/controlled-replay";
  4. import {
  5. approveV4Permission,
  6. prepareV4ConversationE2E,
  7. sendV4Prompt,
  8. waitForV4AssistantMessageContaining,
  9. waitForV4PermissionDialog,
  10. } from "#e2e/helpers/v4-conversation";
  11. import { getLatestUpstreamToolResultByToolCallId } from "#e2e/helpers/conversation-session-network";
  12. // 工作流主链路的英文界面与深色主题(docs/dynamic-workflow/launch.md「The confirmation window」、
  13. // docs/dynamic-workflow/presentation.md「The chat area」「The run pane」、
  14. // docs/dynamic-workflow/transcript-and-notifications.md「The completion card」、DESIGN.md「Theme Modes」)。
  15. //
  16. // 脚本名字、阶段、子代理和回放回答全是 ASCII:这些界面上再出现 CJK,就是漏翻译,不是模型或脚本的文字。
  17. // 确认窗和运行态 run 卡是瞬时界面,所以主题在每个界面就地切换取色(DWI-01 走到哪里取到哪里),
  18. // DWI-02 判定这些取色结果。一次 run 走完全部界面。
  19. const RUN_NAME = "E2E Research Digest";
  20. const AGENTS = ["Digester", "Researcher A", "Researcher B"];
  21. const HELD_AGENT_FIXTURE = "dwi-agent-c";
  22. const RUN_DIGEST = `[data-testid^="${TID_CHAT_WORKFLOW_RUN_DIGEST}"]`;
  23. const COMPLETION_CARD = '[data-workflow-completion-card="true"]';
  24. const RUN_LINE = '[data-workflow-run-line="true"]';
  25. const NOTIFICATION_ROW = '[data-testid^="chat-workflow-notification-row-"]';
  26. const RUN_PHASES = '[data-testid="workflow-run-phases"]';
  27. // 确认窗没有自己的 testid:取包住「Permission required」选项列表的 popover。aria-label 本身也是英文断言。
  28. const PERMISSION_WINDOW = '.bg-popover:has([role="listbox"][aria-label="Permission required"])';
  29. type ThemeName = "zai-light" | "zai-dark";
  30. // DESIGN.md「Text colors」的三档:Primary 是主要阅读文字,其余两档是设计上有意减弱的辅助文字。
  31. const TEXT_TOKENS = [
  32. "--color-foreground",
  33. "--color-foreground-subtle",
  34. "--color-foreground-subtlest",
  35. ] as const;
  36. type TextToken = (typeof TEXT_TOKENS)[number];
  37. type Rgb = [number, number, number];
  38. interface Paint {
  39. background: Rgb;
  40. foreground: Rgb;
  41. /** `--color-popover` 解析成的颜色,确认窗的背景应当正好是它。 */
  42. popoverToken: Rgb;
  43. /** 三档文字 token 合成到当前背景上的颜色,界面文字应当正好是其中声明的一档。 */
  44. textTokens: Record<TextToken, Rgb>;
  45. rootClass: string;
  46. }
  47. type Surface = "window" | "run card" | "completion card" | "notification row" | "run pane";
  48. const paints = new Map<Surface, { token: TextToken } & Record<ThemeName, Paint>>();
  49. let runId = "";
  50. function relativeLuminance(color: Rgb) {
  51. const [r, g, b] = color.map((channel) => {
  52. const value = channel / 255;
  53. return value <= 0.03928 ? value / 12.92 : ((value + 0.055) / 1.055) ** 2.4;
  54. }) as Rgb;
  55. return 0.2126 * r + 0.7152 * g + 0.0722 * b;
  56. }
  57. function contrastRatio(a: Rgb, b: Rgb) {
  58. const [high, low] = [relativeLuminance(a), relativeLuminance(b)].sort((x, y) => y - x) as [
  59. number,
  60. number,
  61. ];
  62. return (high + 0.05) / (low + 0.05);
  63. }
  64. /**
  65. * 读 anchor 文字所在的最深元素的文字色,以及它实际落在什么背景上。
  66. * 计算值可能是 oklab / lab / color(),统一交给 canvas 转成 sRGB;卡片背景带透明度(`bg-card/70`),
  67. * 要沿祖先链往上合成到不透明为止。Electron 根节点为 vibrancy 保持透明,链走完就落到 `--color-background`。
  68. */
  69. async function readPaint(selector: string, anchor: string): Promise<Paint | null> {
  70. return browser.execute(
  71. (scopeSelector: string, anchorText: string, tokenNames: readonly string[]) => {
  72. type Rgba = [number, number, number, number];
  73. const context = document.createElement("canvas").getContext("2d", {
  74. willReadFrequently: true,
  75. })!;
  76. const toRgba = (color: string): Rgba => {
  77. context.clearRect(0, 0, 1, 1);
  78. context.fillStyle = "#010203";
  79. context.fillStyle = color;
  80. if (context.fillStyle === "#010203" && color !== "#010203") {
  81. throw new Error(`canvas 解析不了颜色:${color}`);
  82. }
  83. context.fillRect(0, 0, 1, 1);
  84. const [r, g, b, a] = context.getImageData(0, 0, 1, 1).data as unknown as Rgba;
  85. return [r, g, b, a / 255];
  86. };
  87. const over = (top: Rgba, under: Rgba): Rgba => {
  88. const alpha = top[3] + under[3] * (1 - top[3]);
  89. if (alpha === 0) return [0, 0, 0, 0];
  90. const mix = (index: 0 | 1 | 2) =>
  91. (top[index] * top[3] + under[index] * under[3] * (1 - top[3])) / alpha;
  92. return [mix(0), mix(1), mix(2), alpha];
  93. };
  94. const scope = document.querySelector<HTMLElement>(scopeSelector);
  95. if (!scope || !(scope.textContent ?? "").includes(anchorText)) return null;
  96. let element: HTMLElement = scope;
  97. for (;;) {
  98. const child = Array.from(element.children).find((candidate) =>
  99. (candidate.textContent ?? "").includes(anchorText),
  100. );
  101. if (!(child instanceof HTMLElement)) break;
  102. element = child;
  103. }
  104. const rootStyle = getComputedStyle(document.documentElement);
  105. let background = toRgba(rootStyle.getPropertyValue("--color-background").trim());
  106. const chain: HTMLElement[] = [];
  107. for (let node: HTMLElement | null = element; node; node = node.parentElement) {
  108. chain.push(node);
  109. }
  110. for (const node of chain.reverse()) {
  111. background = over(toRgba(getComputedStyle(node).backgroundColor), background);
  112. }
  113. const foreground = over(toRgba(getComputedStyle(element).color), background);
  114. const rgb = (color: Rgba) =>
  115. [Math.round(color[0]), Math.round(color[1]), Math.round(color[2])] as [
  116. number,
  117. number,
  118. number,
  119. ];
  120. const popover = toRgba(rootStyle.getPropertyValue("--color-popover").trim());
  121. const textTokens = Object.fromEntries(
  122. tokenNames.map((name) => [
  123. name,
  124. rgb(over(toRgba(rootStyle.getPropertyValue(name).trim()), background)),
  125. ]),
  126. );
  127. return {
  128. background: rgb(background),
  129. foreground: rgb(foreground),
  130. popoverToken: rgb(popover),
  131. textTokens: textTokens as Record<TextToken, Rgb>,
  132. rootClass: document.documentElement.className,
  133. };
  134. },
  135. selector,
  136. anchor,
  137. TEXT_TOKENS,
  138. );
  139. }
  140. async function setThemeAndWait(theme: ThemeName) {
  141. await browser.execute((value: string) => {
  142. const actions = (
  143. window as typeof window & { __testActions?: { setTheme?: (next: string) => void } }
  144. ).__testActions;
  145. if (!actions?.setTheme) throw new Error("缺少主题测试入口");
  146. actions.setTheme(value);
  147. }, theme);
  148. await browser.waitUntil(
  149. async () =>
  150. browser.execute(
  151. (expected: string) => document.documentElement.classList.contains(`theme-${expected}`),
  152. theme,
  153. ),
  154. { timeout: 15000, timeoutMsg: `主题没有切到 ${theme}` },
  155. );
  156. }
  157. /** 切到某个主题,等颜色过渡停下(相邻两次读数相同)再取色。 */
  158. async function readSettledPaint(selector: string, anchor: string, theme: ThemeName) {
  159. await setThemeAndWait(theme);
  160. let previous = "";
  161. let settled: Paint | null = null;
  162. await browser.waitUntil(
  163. async () => {
  164. const paint = await readPaint(selector, anchor);
  165. const current = JSON.stringify(paint);
  166. const stable = paint !== null && current === previous;
  167. previous = current;
  168. settled = paint;
  169. return stable;
  170. },
  171. { timeout: 15000, timeoutMsg: `${selector} 在 ${theme} 下的颜色没有稳定(锚点 ${anchor})` },
  172. );
  173. return settled as unknown as Paint;
  174. }
  175. /** 在当前界面上就地读两个主题的颜色,读完回到浅色,后面的文案断言不受影响。 */
  176. async function captureThemes(surface: Surface, selector: string, anchor: string, token: TextToken) {
  177. const light = await readSettledPaint(selector, anchor, "zai-light");
  178. const dark = await readSettledPaint(selector, anchor, "zai-dark");
  179. await setThemeAndWait("zai-light");
  180. paints.set(surface, { token, "zai-light": light, "zai-dark": dark });
  181. }
  182. /** 收集某个界面可见文字与可读属性里所有含 CJK 的片段;空数组才算没有漏翻译。 */
  183. async function readCjk(selector: string) {
  184. return browser.execute((scopeSelector: string) => {
  185. const cjk = /[⺀-鿿豈-﫿＀-￯]/;
  186. const scope = document.querySelector<HTMLElement>(scopeSelector);
  187. if (!scope) return [`界面不存在:${scopeSelector}`];
  188. const found: string[] = [];
  189. const walker = document.createTreeWalker(scope, NodeFilter.SHOW_TEXT);
  190. while (walker.nextNode()) {
  191. const text = walker.currentNode.textContent ?? "";
  192. if (cjk.test(text)) found.push(text.trim());
  193. }
  194. for (const element of [scope, ...Array.from(scope.querySelectorAll<HTMLElement>("*"))]) {
  195. for (const attribute of ["aria-label", "title", "placeholder"]) {
  196. const value = element.getAttribute(attribute) ?? "";
  197. if (cjk.test(value)) found.push(`[${attribute}] ${value}`);
  198. }
  199. }
  200. return found;
  201. }, selector);
  202. }
  203. async function readTextContent(selector: string) {
  204. return browser.execute(
  205. (scopeSelector: string) => document.querySelector(scopeSelector)?.textContent ?? "",
  206. selector,
  207. );
  208. }
  209. async function readPillStatuses(scopeSelector: string) {
  210. return browser.execute((selector: string) => {
  211. const statuses: Record<string, string> = {};
  212. for (const pill of Array.from(
  213. document.querySelectorAll<HTMLElement>(`${selector} [data-testid="workflow-agent-pill"]`),
  214. )) {
  215. // 失败原因:a6fb6916a8 给完成的子代理 pill 加了 sr-only 的「已完成」文字,整颗 pill 的
  216. // 文本变成「名字+状态」。名字只读 `.wf-pill-name`,状态仍读 data-agent-status。
  217. const name = pill.querySelector(".wf-pill-name")?.textContent ?? "";
  218. statuses[name.trim()] = pill.dataset.agentStatus ?? "";
  219. }
  220. return statuses;
  221. }, scopeSelector);
  222. }
  223. describe("动态工作流 · 英文界面与深色主题", () => {
  224. before(async () => {
  225. await prepareV4ConversationE2E();
  226. // 本 spec 专门验证英文文案:固定界面语言,不跟随宿主系统语言。
  227. await pinE2ELocale("en-US");
  228. await setThemeAndWait("zai-light");
  229. });
  230. after(async () => {
  231. await browser.electron.restoreAllMocks();
  232. await clearAppData();
  233. });
  234. it("DWI-01 确认窗、run 卡、侧栏运行行、通知行、完成卡和 run 侧板全程英文文案,没有 CJK 漏翻译", async function () {
  235. this.timeout(420000);
  236. // 反向对照:扫描必须真能抓到文字节点和属性里的中文,否则后面的空数组什么也证明不了。
  237. await browser.execute(() => {
  238. const control = document.createElement("div");
  239. control.id = "dwi-cjk-control";
  240. control.setAttribute("aria-label", "漏翻译属性");
  241. control.textContent = "漏翻译文字";
  242. document.body.append(control);
  243. });
  244. expect(await readCjk("#dwi-cjk-control")).toEqual(["漏翻译文字", "[aria-label] 漏翻译属性"]);
  245. await browser.execute(() => document.getElementById("dwi-cjk-control")?.remove());
  246. await sendV4Prompt("E2E_DWI_START Study two sources with a workflow and merge the findings.");
  247. // 确认窗。
  248. await waitForV4PermissionDialog();
  249. await browser.waitUntil(
  250. async () => (await readTextContent(PERMISSION_WINDOW)).includes("2 phases"),
  251. { timeout: 30000, timeoutMsg: "确认窗没有写出英文阶段数「2 phases」" },
  252. );
  253. const windowText = await readTextContent(PERMISSION_WINDOW);
  254. expect(windowText).toContain("Run this workflow?");
  255. expect(windowText).toContain(RUN_NAME);
  256. expect(windowText).toContain("Show full script");
  257. expect(await readCjk(PERMISSION_WINDOW)).toEqual([]);
  258. await captureThemes("window", PERMISSION_WINDOW, "Run this workflow?", "--color-foreground");
  259. await approveV4Permission();
  260. await browser.waitUntil(
  261. async () =>
  262. (await getLatestUpstreamToolResultByToolCallId("toolu_dwi_create"))?.isError === false,
  263. { timeout: 60000, timeoutMsg: "CreateWorkflow 未执行成功" },
  264. );
  265. const toolResult = await getLatestUpstreamToolResultByToolCallId("toolu_dwi_create");
  266. runId = /started in the background with ID: (\S+?)\./.exec(toolResult?.content ?? "")![1]!;
  267. // 运行态 run 卡:汇总员的回答被受控流挂起,停在第二阶段。
  268. const digestSelector = `${RUN_DIGEST}[data-workflow-run-id="${runId}"]`;
  269. const digest = await $(digestSelector);
  270. await digest.waitForDisplayed({ timeout: 120000 });
  271. await browser.waitUntil(
  272. async () => {
  273. const pills = await readPillStatuses(digestSelector);
  274. return (
  275. pills["Researcher A"] === "done" &&
  276. pills["Researcher B"] === "done" &&
  277. pills["Digester"] === "running"
  278. );
  279. },
  280. { timeout: 120000, timeoutMsg: "第一阶段没有完成,或 Digester 没有进入运行态" },
  281. );
  282. expect(Object.keys(await readPillStatuses(digestSelector)).sort()).toEqual(AGENTS);
  283. expect(await readTextContent(`${digestSelector} [data-testid="workflow-card-kind"]`)).toContain(
  284. "Workflow running",
  285. );
  286. expect(await readTextContent(`${digestSelector} [data-testid="workflow-card-name"]`)).toContain(
  287. RUN_NAME,
  288. );
  289. const stationTexts = await browser.execute(
  290. (selector: string) =>
  291. Array.from(
  292. document.querySelectorAll(`${selector} [data-testid="workflow-timeline-station"]`),
  293. ).map((station) => station.textContent ?? ""),
  294. digestSelector,
  295. );
  296. expect(stationTexts).toEqual([
  297. expect.stringContaining("Research"),
  298. expect.stringContaining("Digest"),
  299. ]);
  300. expect(await readCjk(digestSelector)).toEqual([]);
  301. await captureThemes("run card", digestSelector, RUN_NAME, "--color-foreground-subtle");
  302. // 侧栏运行行写当前阶段名。
  303. await $(RUN_LINE).waitForDisplayed({ timeout: 60000 });
  304. await browser.waitUntil(async () => (await readTextContent(RUN_LINE)).includes("Digest"), {
  305. timeout: 60000,
  306. timeoutMsg: "侧栏运行行没有写出当前阶段「Digest」",
  307. });
  308. expect(await readCjk(RUN_LINE)).toEqual([]);
  309. await releaseControlledReplay(HELD_AGENT_FIXTURE);
  310. await browser.waitUntil(
  311. async () => (await digest.getAttribute("data-workflow-run-status")) === "completed",
  312. { timeout: 120000, timeoutMsg: "run 没有到达完成态" },
  313. );
  314. expect(await readTextContent(`${digestSelector} [data-testid="workflow-card-kind"]`)).toContain(
  315. "Workflow completed",
  316. );
  317. expect(await readCjk(digestSelector)).toEqual([]);
  318. await waitForV4AssistantMessageContaining("E2E_DWI_DONE", 120000);
  319. // 发起行摘要。已结束一轮的工具行收在折叠里,发起行在第一轮:先展开。
  320. await browser.execute(() => {
  321. const first = document.querySelector<HTMLElement>(
  322. '[data-testid^="chat-assistant-history-trigger-"]',
  323. );
  324. if (first?.dataset.historyOpen === "false") first.click();
  325. });
  326. const summarySelector = `[data-testid="workflow-tool-summary"][data-workflow-run-id="${runId}"]`;
  327. await browser.waitUntil(
  328. async () => /3 subagents/.test(await readTextContent(summarySelector)),
  329. { timeout: 30000, timeoutMsg: "发起行摘要没有写出英文的子代理计数" },
  330. );
  331. expect(await readCjk(summarySelector)).toEqual([]);
  332. // 通知行:kindLabel + 名字,展开体是返回值。
  333. const row = await $(NOTIFICATION_ROW);
  334. await row.waitForDisplayed({ timeout: 60000 });
  335. const rowText = await readTextContent(NOTIFICATION_ROW);
  336. expect(rowText).toContain("Workflow completed");
  337. expect(rowText).toContain(RUN_NAME);
  338. await row.$('[role="button"]').click();
  339. const result = await row.$('[data-testid="workflow-notification-result"]');
  340. await result.waitForDisplayed({ timeout: 10000 });
  341. // JSON 结果画在 CodeViewer 的 shadow DOM 里,textContent 读不到:这里用 getText。
  342. await expect(result).toHaveText(expect.stringContaining("E2E_DWI_ANSWER_C"));
  343. expect(await readCjk(NOTIFICATION_ROW)).toEqual([]);
  344. // 失败原因:d6b55b9d5e 统一工具行摘要配色,非运行态 kindLabel 改为 Secondary
  345. // (text-foreground-subtle);通知行复用 ToolLayout,与工具行同族,不再是 Tertiary。
  346. await captureThemes(
  347. "notification row",
  348. NOTIFICATION_ROW,
  349. "Workflow completed",
  350. "--color-foreground-subtle",
  351. );
  352. // 完成卡:kind、名字、四格数字的标签。数字计数动画结束后再读。
  353. const card = await $(COMPLETION_CARD);
  354. await card.waitForDisplayed({ timeout: 60000 });
  355. await browser.waitUntil(
  356. async () =>
  357. (await card
  358. .$('[data-testid="workflow-completion-figure-subagents"]')
  359. .getAttribute("data-value")) === "3" &&
  360. (await card
  361. .$('[data-testid="workflow-completion-figure-phases"]')
  362. .getAttribute("data-value")) === "2",
  363. { timeout: 10000, timeoutMsg: "完成卡的子代理 / 阶段数字不是 3 / 2" },
  364. );
  365. const cardText = await readTextContent(COMPLETION_CARD);
  366. expect(cardText).toContain("Workflow completed");
  367. expect(cardText).toContain(RUN_NAME);
  368. expect(
  369. await readTextContent(`${COMPLETION_CARD} [data-testid="workflow-completion-figures"]`),
  370. ).toEqual(expect.stringMatching(/time[\s\S]*tokens[\s\S]*subagents[\s\S]*phases/i));
  371. expect(await readCjk(COMPLETION_CARD)).toEqual([]);
  372. await captureThemes(
  373. "completion card",
  374. COMPLETION_CARD,
  375. "Workflow completed",
  376. "--color-foreground",
  377. );
  378. // run 侧板:两段英文阶段,结果面板写「Result」。
  379. await card.$('[data-testid="workflow-card-open-details"]').click();
  380. await $(RUN_PHASES).waitForDisplayed({ timeout: 60000 });
  381. const paneSelector = `div[data-workflow-run-id="${runId}"]:has(${RUN_PHASES})`;
  382. const toggles = await browser.execute(
  383. (selector: string) =>
  384. Array.from(
  385. document.querySelectorAll(`${selector} [data-testid="workflow-run-phase-toggle"]`),
  386. ).map((toggle) => toggle.textContent ?? ""),
  387. RUN_PHASES,
  388. );
  389. expect(toggles).toEqual([
  390. expect.stringContaining("Research"),
  391. expect.stringContaining("Digest"),
  392. ]);
  393. expect(await readTextContent(paneSelector)).toContain("Result");
  394. expect(await readCjk(paneSelector)).toEqual([]);
  395. await captureThemes("run pane", RUN_PHASES, "Research", "--color-foreground");
  396. });
  397. it("DWI-02 同一批界面在深色主题下画深色 token:背景和文字都与浅色不同,文字对比度够读", async function () {
  398. expect([...paints.keys()].sort()).toEqual([
  399. "completion card",
  400. "notification row",
  401. "run card",
  402. "run pane",
  403. "window",
  404. ]);
  405. const failures: string[] = [];
  406. for (const [surface, { token, "zai-light": light, "zai-dark": dark }] of paints) {
  407. const describePaint = JSON.stringify({ light, dark });
  408. if (!dark.rootClass.split(" ").includes("dark")) {
  409. failures.push(`${surface}: 深色下根节点没有 dark class ${describePaint}`);
  410. }
  411. if (light.rootClass.split(" ").includes("dark")) {
  412. failures.push(`${surface}: 浅色下根节点仍有 dark class ${describePaint}`);
  413. }
  414. if (relativeLuminance(dark.background) >= 0.1) {
  415. failures.push(`${surface}: 深色背景不够深 ${describePaint}`);
  416. }
  417. if (relativeLuminance(light.background) <= 0.6) {
  418. failures.push(`${surface}: 浅色背景不够浅 ${describePaint}`);
  419. }
  420. if (relativeLuminance(dark.foreground) <= relativeLuminance(dark.background)) {
  421. failures.push(`${surface}: 深色下文字没有比背景亮 ${describePaint}`);
  422. }
  423. for (const [theme, paint] of [
  424. ["light", light],
  425. ["dark", dark],
  426. ] as const) {
  427. // 文字画的是声明的那一档 token(合成后容差 3,canvas 转换有取整误差)。
  428. const expected = paint.textTokens[token];
  429. if (paint.foreground.some((channel, index) => Math.abs(channel - expected[index]!) > 3)) {
  430. failures.push(`${surface}: ${theme} 文字不是 ${token} ${describePaint}`);
  431. }
  432. // Primary 是主要阅读文字,要够读;Secondary / Tertiary 是设计上减弱的文字,不套这个下限。
  433. const ratio = contrastRatio(paint.foreground, paint.background);
  434. if (token === "--color-foreground" && ratio < 4.5) {
  435. failures.push(`${surface}: ${theme} 对比度 ${ratio.toFixed(2)} < 4.5 ${describePaint}`);
  436. }
  437. }
  438. }
  439. // 确认窗是不透明的 `bg-popover`:背景应当正好解析成当前主题的 token,而不是写死的颜色。
  440. const windowPaint = paints.get("window")!;
  441. for (const paint of [windowPaint["zai-light"], windowPaint["zai-dark"]]) {
  442. if (paint.background.some((channel, index) => channel !== paint.popoverToken[index])) {
  443. failures.push(`window: 背景不等于 --color-popover ${JSON.stringify(paint)}`);
  444. }
  445. }
  446. expect(failures).toEqual([]);
  447. });
  448. });