Skip to content

Commit 66e0fef

Browse files
committed
for justifyContent
1 parent ac6f03b commit 66e0fef

File tree

2 files changed

+32
-7
lines changed

2 files changed

+32
-7
lines changed

libs/components/src/layout/Flex/tests.tsx

+32
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,37 @@ describe("Flex", () => {
3434
expect(FlexElement).toHaveStyle("flex-direction: row");
3535
});
3636
});
37+
describe("for justifyContent", () => {
38+
it("should render with justifyContent center", () => {
39+
render(<Flex justifyContent="center">FlexChild</Flex>);
40+
const FlexElement = screen.getByText("FlexChild");
41+
expect(FlexElement).toHaveStyle("justify-content: center");
42+
});
43+
it("should render with justifyContent end", () => {
44+
render(<Flex justifyContent="end">FlexChild</Flex>);
45+
const FlexElement = screen.getByText("FlexChild");
46+
expect(FlexElement).toHaveStyle("justify-content: flex-end");
47+
});
48+
it("should render with justifyContent spaceBetween", () => {
49+
render(<Flex justifyContent="spaceBetween">FlexChild</Flex>);
50+
const FlexElement = screen.getByText("FlexChild");
51+
expect(FlexElement).toHaveStyle("justify-content: space-between");
52+
});
53+
it("should render with justifyContent spaceAround", () => {
54+
render(<Flex justifyContent="spaceAround">FlexChild</Flex>);
55+
const FlexElement = screen.getByText("FlexChild");
56+
expect(FlexElement).toHaveStyle("justify-content: space-around");
57+
});
58+
it("should render with justifyContent spaceEvenly", () => {
59+
render(<Flex justifyContent="spaceEvenly">FlexChild</Flex>);
60+
const FlexElement = screen.getByText("FlexChild");
61+
expect(FlexElement).toHaveStyle("justify-content: space-evenly");
62+
});
63+
it("should render with justifyContent stretch", () => {
64+
render(<Flex justifyContent="stretch">FlexChild</Flex>);
65+
const FlexElement = screen.getByText("FlexChild");
66+
expect(FlexElement).toHaveStyle("justify-content: stretch");
67+
});
68+
});
3769
});
3870
});

libs/components/src/tests.ts

-7
This file was deleted.

0 commit comments

Comments
 (0)