diff --git a/test/samples.ui.test.tsx b/test/samples.ui.test.tsx index 0c3a4c5..1197249 100644 --- a/test/samples.ui.test.tsx +++ b/test/samples.ui.test.tsx @@ -155,10 +155,11 @@ test("an independent reviewer can approve a request and retry a manual dispatch" const user = userEvent.setup(); await user.click(screen.getByRole("button", { name: "Test login" })); await user.selectOptions(await screen.findByRole("combobox", { name: /Review decision/ }), "APPROVED"); - await user.type(screen.getByRole("textbox", { name: /Review note/ }), approved.note); + fireEvent.change(screen.getByRole("textbox", { name: /Review note/ }), { target: { value: approved.note } }); await user.click(screen.getByRole("button", { name: "Record sample decision" })); - await user.type(await screen.findByRole("textbox", { name: /Dispatch reference/ }), dispatched.dispatchReference); - await user.type(screen.getByRole("textbox", { name: /Dispatch note/ }), dispatched.note); + expect(decision).toEqual({ decision: "APPROVED", note: approved.note, idempotencyKey: expect.any(String) }); + fireEvent.change(await screen.findByRole("textbox", { name: /Dispatch reference/ }), { target: { value: dispatched.dispatchReference } }); + fireEvent.change(screen.getByRole("textbox", { name: /Dispatch note/ }), { target: { value: dispatched.note } }); await user.click(screen.getByRole("button", { name: "Record dispatch" })); await user.click(await screen.findByRole("button", { name: "Retry dispatch" })); await screen.findByRole("cell", { name: dispatched.dispatchReference });