test: expect Pending disabled on dated inline draft

This commit is contained in:
Alexandre Brandizzi 2026-09-29 13:12:11 -03:00
parent 7d5d015602
commit 5ace29eda4

View file

@ -36,7 +36,7 @@ vi.mock("@/app/(protected)/workorders/_components/list/table/cells/appt-time-cel
}));
describe("WoTableInlineRow StatusCell with a concrete schedule", () => {
it("keeps Scheduled when Incomplete is picked on a dated draft", () => {
it("disables Pending on a dated draft", () => {
const onChange = vi.fn();
const draft = {
...EMPTY_TABLE_DRAFT,
@ -66,8 +66,10 @@ describe("WoTableInlineRow StatusCell with a concrete schedule", () => {
);
fireEvent.click(screen.getByRole("button", { name: /incomplete/i }));
fireEvent.click(screen.getByRole("button", { name: /^pending$/i }));
const pending = screen.getByRole("button", { name: /^pending$/i });
expect(onChange).toHaveBeenCalledWith(expect.objectContaining({ status: "Scheduled" }));
expect(pending).toBeDisabled();
fireEvent.click(pending);
expect(onChange).not.toHaveBeenCalledWith(expect.objectContaining({ status: "Pending" }));
});
});