fix(web): restore tool expansion directly
This commit is contained in:
@@ -116,7 +116,7 @@ describe("structured connection: data flow", () => {
|
||||
conn.dispose();
|
||||
});
|
||||
|
||||
it("keeps an expanded running tool open when its stable row is patched", () => {
|
||||
it("keeps an expanded running tool open without emitting a click when patched", () => {
|
||||
const ws = new FakeSocket();
|
||||
const conn = mount({ sockets: [ws] });
|
||||
ws.open();
|
||||
@@ -138,6 +138,8 @@ describe("structured connection: data flow", () => {
|
||||
const originalHead = conn.el.querySelector<HTMLButtonElement>(".st-tool-head")!;
|
||||
originalHead.click();
|
||||
expect(originalHead.getAttribute("aria-expanded")).toBe("true");
|
||||
const clickListener = vi.fn();
|
||||
window.addEventListener("click", clickListener, { capture: true, once: true });
|
||||
|
||||
ws.emit({
|
||||
type: "projection_update",
|
||||
@@ -152,6 +154,8 @@ describe("structured connection: data flow", () => {
|
||||
state: idleState,
|
||||
});
|
||||
|
||||
expect(clickListener).not.toHaveBeenCalled();
|
||||
window.removeEventListener("click", clickListener, true);
|
||||
const patchedHead = conn.el.querySelector<HTMLButtonElement>(".st-tool-head")!;
|
||||
expect(patchedHead).not.toBe(originalHead);
|
||||
expect(patchedHead.getAttribute("aria-expanded")).toBe("true");
|
||||
|
||||
Reference in New Issue
Block a user