Skip to content

Commit 43aa405

Browse files
nattogJohn Richard Chipps-Harding
andauthored
Add data attribute test (#8)
Co-authored-by: John Richard Chipps-Harding <[email protected]>
1 parent 00e9b9f commit 43aa405

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/index.test.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,15 @@ describe("Basic functionality", () => {
4646
const { container } = render(<Input value={"test"} onChange={onChange} />);
4747
expect(container.firstChild).toHaveAttribute("value", "test");
4848
});
49+
50+
it("should provide support for data attributes", async () => {
51+
const Input = styled("input");
52+
const onChange = jest.fn();
53+
const { container } = render(
54+
<Input value={"test"} onChange={onChange} data-section="Login Form" />
55+
);
56+
expect(container.firstChild).toHaveAttribute("data-section", "Login Form");
57+
});
4958
});
5059

5160
describe("supports variants and compound variants", () => {

0 commit comments

Comments
 (0)