Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,9 @@ const type = (container: HTMLElement, value: string) =>
});

const clickRun = () =>
fireEvent.click(screen.getByRole("button", { name: "▶" }));
// By its text, not getByRole: in jsdom, a role query works out every
// element's accessible role and name, which here takes about a second
fireEvent.click(screen.getByText("▶").closest("button") as HTMLElement);

/** What was saved to the flow, by property. */
const saved = (prop: string) =>
Expand Down Expand Up @@ -303,7 +305,9 @@ describe("a Prompt Node, as it always has", () => {
// The variant controls' trash icon comes before the models'
const trash = container.querySelector(".tabler-icon-trash") as SVGElement;
fireEvent.click(trash.closest("button") as HTMLButtonElement);
fireEvent.click(await screen.findByRole("button", { name: "Confirm" }));
fireEvent.click(
(await screen.findByText("Confirm")).closest("button") as HTMLElement,
);
await wait(0);
expect(saved("prompt")).toEqual([["A", "C"]]);
expect(saved("promptVariantLabel")).toEqual([]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,9 @@ const type = (container: HTMLElement, value: string) =>
});

const clickRun = () =>
fireEvent.click(screen.getByRole("button", { name: "▶" }));
// By its text, not getByRole: in jsdom, a role query works out every
// element's accessible role and name, which here takes about a second
fireEvent.click(screen.getByText("▶").closest("button") as HTMLElement);

/** What each query was sent: its prompt, its models and its inputs. */
const promptsSent = () => mockQueryLLM.mock.calls.map((call) => call[3]);
Expand Down
Loading