test(FN-4520): complete Step 3 — add sent-bubble mention contrast regression assertions
Fusion-Task-Id: FN-4520 Fusion-Task-Lineage: fee9ca34-d68e-4ec9-b4f9-134e139a7df7
This commit is contained in:
@@ -1634,16 +1634,21 @@ describe("ChatView", () => {
|
||||
id: "room-msg-1",
|
||||
roomId: "room-001",
|
||||
role: "user",
|
||||
content: "Ping @Beta",
|
||||
content: "Ping @Alpha and @Beta",
|
||||
senderAgentId: "agent-001",
|
||||
metadata: null,
|
||||
attachments: [],
|
||||
mentions: ["agent-002"],
|
||||
mentions: ["agent-001", "agent-002"],
|
||||
createdAt: "2026-04-08T00:00:00.000Z",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
const allCss = await loadAllAppCss();
|
||||
const style = document.createElement("style");
|
||||
style.textContent = allCss;
|
||||
document.head.appendChild(style);
|
||||
|
||||
render(<ChatView projectId="proj-123" addToast={vi.fn()} experimentalFeatures={{ chatRooms: true }} />);
|
||||
|
||||
await userEvent.click(screen.getByTestId("chat-sidebar-scope-rooms"));
|
||||
@@ -1653,8 +1658,17 @@ describe("ChatView", () => {
|
||||
expect(await screen.findByTestId("agent-mention-members-header")).toBeInTheDocument();
|
||||
expect(screen.queryByTestId("agent-mention-others-header")).not.toBeInTheDocument();
|
||||
|
||||
const bubble = screen.getByText("Ping", { exact: false }).closest(".chat-message--user");
|
||||
expect(bubble).toBeTruthy();
|
||||
|
||||
const memberChip = screen.getByText("@Alpha", { selector: ".chat-mention-chip" });
|
||||
const nonMemberChip = screen.getByText("@Beta", { selector: ".chat-mention-chip--non-member" });
|
||||
expect(nonMemberChip).toHaveAttribute("title", "Not a member of engineering");
|
||||
|
||||
// FN-4520: member mention chip text must not visually collapse into sent-bubble background.
|
||||
expect(getComputedStyle(memberChip).color).not.toBe(getComputedStyle(bubble as Element).backgroundColor);
|
||||
// FN-4520: non-member mention chip text must remain legible inside sent bubbles.
|
||||
expect(getComputedStyle(nonMemberChip).color).not.toBe(getComputedStyle(bubble as Element).backgroundColor);
|
||||
});
|
||||
|
||||
it("renders assistant mentions as plain text in markdown mode", async () => {
|
||||
|
||||
@@ -943,6 +943,11 @@ describe("QuickChatFAB session-first UX", () => {
|
||||
|
||||
const nonMemberChip = await screen.findByText("@Agent_Two", { selector: ".chat-mention-chip--non-member" });
|
||||
expect(nonMemberChip).toHaveAttribute("title", "Not a member of engineering");
|
||||
|
||||
const sentBubble = nonMemberChip.closest(".quick-chat-panel-message--sent");
|
||||
expect(sentBubble).toBeTruthy();
|
||||
// FN-4520: quick-chat mention chip text must stay distinct from sent-bubble background.
|
||||
expect(getComputedStyle(nonMemberChip).color).not.toBe(getComputedStyle(sentBubble as Element).backgroundColor);
|
||||
});
|
||||
|
||||
it("FN-3884: snaps to bottom when switching sessions while open", async () => {
|
||||
|
||||
Reference in New Issue
Block a user