fix(webui): add a close control to the expanded context panel (#6629)
This commit is contained in:
1 parent
27f1a836b5
commit
e3a1af2ed3
5 files changed
+32
-9
No files matched your search
@@ -35,6 +35,16 @@ describe("Context sidebar", () => {
|
||||
await waitFor(() => expect(screen.getByTestId("composer-context-usage")).toHaveFocus());
|
||||
});
|
||||
|
||||
it("closes the sidebar from its own control", async () => {
|
||||
const user = userEvent.setup();
|
||||
render(<ComposerUsagePopover context={null} rounds={[]} snapshots={[first]} />);
|
||||
await user.click(screen.getByTestId("composer-context-usage"));
|
||||
const sidebar = screen.getByRole("complementary", { name: "Context usage" });
|
||||
await user.click(within(sidebar).getByRole("button", { name: "Close" }));
|
||||
await waitFor(() => expect(screen.queryByRole("complementary")).not.toBeInTheDocument());
|
||||
expect(screen.getByTestId("composer-context-usage")).toHaveFocus();
|
||||
});
|
||||
|
||||
it("mounts in the conversation's side slot and closes with Escape from its controls", async () => {
|
||||
const user = userEvent.setup();
|
||||
const host = document.createElement("section");
|
||||
|
||||
Reference in new issue
Block a user