File tree 1 file changed +24
-0
lines changed
libs/components/src/layout/Flex
1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change
1
+ import { render , screen } from "@tests-unit-browser" ;
2
+ import "@testing-library/jest-dom" ;
3
+
4
+ import { Flex } from "@lib-components" ;
5
+
6
+ describe ( "Flex" , ( ) => {
7
+ it ( "should render without required props default config" , ( ) => {
8
+ render ( < Flex testId = "flexId" > FlexChild</ Flex > ) ;
9
+ const FlexElement = screen . getByTestId ( "flexId" ) ;
10
+
11
+ expect ( FlexElement ) . toBeInTheDocument ( ) ;
12
+ expect ( FlexElement ) . toHaveTextContent ( "FlexChild" ) ;
13
+ expect ( FlexElement ) . toHaveStyle ( "display: flex" ) ;
14
+ expect ( FlexElement ) . toHaveStyle ( "flex-direction: row" ) ;
15
+ expect ( FlexElement ) . toHaveStyle ( "justify-content: flex-start" ) ;
16
+ expect ( FlexElement ) . toHaveStyle ( "align-items: flex-start" ) ;
17
+ expect ( FlexElement ) . toHaveStyle ( "flex-wrap: nowrap" ) ;
18
+ expect ( FlexElement ) . toHaveStyle ( "gap: 0rem" ) ;
19
+ expect ( FlexElement ) . toHaveStyle ( "margin: 0rem" ) ;
20
+ expect ( FlexElement ) . toHaveStyle ( "padding: 0rem" ) ;
21
+ expect ( FlexElement ) . toHaveStyle ( "height: auto" ) ;
22
+ expect ( FlexElement ) . toHaveStyle ( "width: auto" ) ;
23
+ } ) ;
24
+ } ) ;
You can’t perform that action at this time.
0 commit comments