From 27e59dac18f071bc647af6293bf84a371221eaac Mon Sep 17 00:00:00 2001 From: MT-Mint <798521692@qq.com> Date: Wed, 15 Apr 2026 10:20:32 +0800 Subject: [PATCH] test(phase-06): add @ reference e2e scenarios with explainable skip --- frontend/tests/e2e/input-and-compose.spec.ts | 31 ++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/frontend/tests/e2e/input-and-compose.spec.ts b/frontend/tests/e2e/input-and-compose.spec.ts index 6700318f..61699914 100644 --- a/frontend/tests/e2e/input-and-compose.spec.ts +++ b/frontend/tests/e2e/input-and-compose.spec.ts @@ -120,4 +120,35 @@ test.describe("聊天工作台 / 输入区与发送", () => { page.locator(".is-user").filter({ hasText: "重复提交测试" }), ).toHaveCount(1); }); + + test("DF-INPUT-007 输入@时展示文件候选并可选择为引用 chip", async ( + { page }, + testInfo, + ) => { + skipIfMissingThread(testInfo, THREAD_FOR_WELCOME, "FRONTEND_E2E_THREAD_ID"); + await openChat(page, reuseThreadChatEntry(THREAD_FOR_WELCOME!)); + + const textarea = page.locator("textarea[name='message']"); + await textarea.click(); + await textarea.fill("@"); + + const dropdown = page.locator("[data-slot='dropdown-menu-content']").first(); + const items = dropdown.locator("[data-slot='dropdown-menu-item']"); + const itemCount = await items.count(); + testInfo.skip(itemCount === 0, "当前线程没有可引用文件候选。"); + + await items.first().click(); + await expect(page.getByLabel("移除引用").first()).toBeVisible(); + }); + + test("DF-INPUT-008 失效引用不会阻断文本发送(可解释 skip)", async ( + { page }, + testInfo, + ) => { + skipIfMissingThread(testInfo, THREAD_FOR_WELCOME, "FRONTEND_E2E_THREAD_ID"); + await openChat(page, reuseThreadChatEntry(THREAD_FOR_WELCOME!)); + + // 该场景依赖特定后端/fixture 能制造 stale 引用;若环境无能力则显式跳过。 + testInfo.skip(true, "当前 E2E 环境无法稳定注入 stale 引用,使用 hooks 单测覆盖软失败逻辑。"); + }); });