From 7fb0ce5b3539cbf5e21698fc9d5e341b7c26ca07 Mon Sep 17 00:00:00 2001 From: "Ragdoll-Opus-5.5" Date: Sat, 26 Sep 2026 18:42:23 +0800 Subject: [PATCH] test(F117): queue chip claims stop matching the panel's own header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Why: five web tests fail on develop_base (52b80e1f6). They assert that the Queue Panel shows no '排队等待' author-intent chip, which F117 (f426fb790) removed, but they read the whole panel text, and the panel header itself reads '排队等待中' (63921725d). So they fail even though no chip renders, and a fork PR's full gate fails at the web unit stage. The assertions now read the panel text without that one header label; the chip-specific checks (data-testid intent-chip-* is null) are unchanged. Before: f264-queue-ux-hierarchy 4 failed, queue-panel-steer 1 failed. After: both files 44/44; web tsc clean. [宪宪/claude-opus-5-5🐾] Co-Authored-By: Claude Opus 5.5 --- .../__tests__/f264-queue-ux-hierarchy.test.tsx | 11 ++++++++--- .../components/__tests__/queue-panel-steer.test.ts | 7 ++++++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/packages/web/src/components/__tests__/f264-queue-ux-hierarchy.test.tsx b/packages/web/src/components/__tests__/f264-queue-ux-hierarchy.test.tsx index 79014a4816..17d165d608 100644 --- a/packages/web/src/components/__tests__/f264-queue-ux-hierarchy.test.tsx +++ b/packages/web/src/components/__tests__/f264-queue-ux-hierarchy.test.tsx @@ -14,6 +14,11 @@ import { } from '../message-disposition-presentation'; import { QueuePanel } from '../QueuePanel'; +/** The panel header itself reads 排队等待中; the claims below are about per-row route chips. */ +function textWithoutPanelHeader(container: HTMLElement): string { + return (container.textContent ?? '').replace('排队等待中', ''); +} + vi.mock('@/utils/api-client', () => ({ apiFetch: vi.fn(async () => ({ ok: true, json: async () => ({}) })), })); @@ -248,7 +253,7 @@ describe('F264 Queue UX hierarchy — component claims', () => { useChatStore.setState({ queue: [continueEntry, nextEntry] }); renderQueuePanel(); - const text = container.textContent ?? ''; + const text = textWithoutPanelHeader(container); expect(text).not.toContain('立即发送,引导回复'); expect(text).not.toContain('排队等待'); expect(container.querySelectorAll('[data-queue-target-row="opus"]')).toHaveLength(2); @@ -276,7 +281,7 @@ describe('F264 Queue UX hierarchy — component claims', () => { renderQueuePanel(); expect(container.querySelector(`[data-testid="intent-chip-q-${source}-opus"]`)).toBeNull(); - expect(container.textContent).not.toContain('排队等待'); + expect(textWithoutPanelHeader(container)).not.toContain('排队等待'); expect(container.textContent).not.toContain('立即发送,引导回复'); }); @@ -451,7 +456,7 @@ describe('F264 Queue UX hierarchy — component claims', () => { renderQueuePanel(); expect(container.querySelectorAll('[data-queue-target-row]')).toHaveLength(2); - const text = container.textContent ?? ''; + const text = textWithoutPanelHeader(container); expect(text).not.toContain('立即发送,引导回复'); expect(text).not.toContain('排队等待'); expect(text).not.toContain('当前接入不支持'); diff --git a/packages/web/src/components/__tests__/queue-panel-steer.test.ts b/packages/web/src/components/__tests__/queue-panel-steer.test.ts index 525ac378ac..6c8cd9e114 100644 --- a/packages/web/src/components/__tests__/queue-panel-steer.test.ts +++ b/packages/web/src/components/__tests__/queue-panel-steer.test.ts @@ -12,6 +12,11 @@ import { useToastStore } from '@/stores/toastStore'; import { apiFetch } from '@/utils/api-client'; import { QueuePanel } from '../QueuePanel'; +/** The panel header itself reads 排队等待中; the claims below are about per-row route chips. */ +function textWithoutPanelHeader(container: HTMLElement): string { + return (container.textContent ?? '').replace('排队等待中', ''); +} + vi.mock('@/hooks/useCatData', () => ({ useCatData: () => { const cats = [ @@ -844,7 +849,7 @@ describe('QueuePanel steer (F047)', () => { root.render(React.createElement(QueuePanel, { threadId: 'thread-1' })); }); - expect(container.textContent).not.toContain('排队等待'); + expect(textWithoutPanelHeader(container)).not.toContain('排队等待'); expect(container.textContent).not.toContain('当前接入不支持引导回复'); expect(container.querySelector('[data-testid="remind-q1-opus"]')).toBeNull(); });