FN-5745: optimize ChatView agent-mentions test timing

Reduce interaction overhead in the ChatView agent-mentions test while preserving coverage.

- Switch the test to a local  instance for faster click/type interactions.
- Reuse that configured user instance for both room-scope selection and mention trigger typing.
- Replace async DOM lookup with immediate assertion once the mention header is expected to be present.

Files changed:
 packages/dashboard/app/components/__tests__/ChatView.test.tsx | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Fusion-Task-Id: FN-5745

Fusion-Task-Lineage: f65364d0-951e-4945-bc8b-42bf99e8a5e6
This commit is contained in:
gsxdsm
2026-05-30 14:57:14 -07:00
parent 3a6820422b
commit 8e2c192855

View File

@@ -1670,11 +1670,12 @@ describe("ChatView", () => {
render(<ChatView projectId="proj-123" addToast={vi.fn()} experimentalFeatures={{ chatRooms: true }} />);
await userEvent.click(screen.getByTestId("chat-sidebar-scope-rooms"));
const user = userEvent.setup({ delay: null });
await user.click(screen.getByTestId("chat-sidebar-scope-rooms"));
const textarea = screen.getByTestId("chat-input");
await userEvent.type(textarea, "@");
await user.type(textarea, "@");
expect(await screen.findByTestId("agent-mention-members-header")).toBeInTheDocument();
expect(screen.getByTestId("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");