mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-09-30 04:33:11 +00:00
test: expect Pending disabled on dated inline draft
This commit is contained in:
parent
7d5d015602
commit
5ace29eda4
1 changed files with 5 additions and 3 deletions
|
|
@ -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" }));
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue