test: make sample approval and dispatch fixtures deterministic
This commit is contained in:
parent
cdcf0d9898
commit
6bd1940f5e
|
|
@ -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 });
|
||||
|
|
|
|||
Loading…
Reference in New Issue