feat(FN-4095): restore green verification gates and add QuickChatFAB regres
Restores green verification gates for executor review verdicts (FN-4095) with a targeted core store change, and adds a regression test ensuring the QuickChatFAB scrolls to the bottom when opened. Fusion-Task-Id: FN-4095
This commit is contained in:
@@ -811,4 +811,29 @@ describe("QuickChatFAB session-first UX", () => {
|
||||
expect(scrollTopValue).toBe(scrollHeightValue);
|
||||
});
|
||||
});
|
||||
|
||||
it("FN-4095: snaps to bottom on uncontrolled initial open (FAB click) with preloaded messages", async () => {
|
||||
mockFetchChatMessages.mockResolvedValueOnce({
|
||||
messages: [{ id: "msg-open", sessionId: "session-model", role: "assistant", content: "Loaded", createdAt: new Date().toISOString() }],
|
||||
});
|
||||
|
||||
render(<QuickChatFAB addToast={vi.fn()} projectId="proj-1" />);
|
||||
fireEvent.click(screen.getByTestId("quick-chat-fab"));
|
||||
|
||||
const messages = await screen.findByTestId("quick-chat-messages");
|
||||
let scrollTopValue = 0;
|
||||
const scrollHeightValue = 1400;
|
||||
Object.defineProperty(messages, "scrollHeight", { configurable: true, get: () => scrollHeightValue });
|
||||
Object.defineProperty(messages, "scrollTop", {
|
||||
configurable: true,
|
||||
get: () => scrollTopValue,
|
||||
set: (value: number) => {
|
||||
scrollTopValue = value;
|
||||
},
|
||||
});
|
||||
|
||||
await waitFor(() => {
|
||||
expect(scrollTopValue).toBe(scrollHeightValue);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user