Skip to content

Commit

Permalink
adding test
Browse files Browse the repository at this point in the history
  • Loading branch information
fneves committed Nov 13, 2023
1 parent e94920e commit fee8bbc
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,16 @@ describe("Dialog Component", () => {
onOpenChange: (b: boolean) => open = b
});


expect(queryAllByText(title).length).toEqual(1);
const secondaryActionBtn = getByText(secondaryActionLabel);
fireEvent.click(secondaryActionBtn);
expect(open).toEqual(false);
});

it("fails to render in case you provide both children and message props", () => {
const children = <div>test</div>;
const message = "this is a test message";

expect(() => renderDialog({ children, message, open: true })).toThrowError("You can't pass children and message props at the same time");
});
});

0 comments on commit fee8bbc

Please sign in to comment.