1
+ import { render } from '@shared/tests' ;
1
2
import { createPassThroughPropsTest } from '@shared/tests/utils' ;
2
- import { mount } from 'enzyme' ;
3
3
import { Form } from '@ui5/webcomponents-react/lib/Form' ;
4
4
import { FormGroup } from '@ui5/webcomponents-react/lib/FormGroup' ;
5
5
import { FormItem } from '@ui5/webcomponents-react/lib/FormItem' ;
@@ -36,26 +36,26 @@ const component = (
36
36
describe ( 'Create a Form' , ( ) => {
37
37
test ( 'size rate S; should create Label and Element with 100% width and display: block for top FormItem div' , ( ) => {
38
38
window = Object . assign ( window , { innerWidth : SIZE_S } ) ;
39
- const wrapper = mount ( component ) ;
40
- expect ( wrapper . render ( ) ) . toMatchSnapshot ( ) ;
39
+ const { asFragment } = render ( component ) ;
40
+ expect ( asFragment ( ) ) . toMatchSnapshot ( ) ;
41
41
} ) ;
42
42
43
43
test ( 'size rate M; should create Label and Element with 16% and 83% width respectively and display: flex for top FormItem div' , ( ) => {
44
44
window = Object . assign ( window , { innerWidth : SIZE_M } ) ;
45
- const wrapper = mount ( component ) ;
46
- expect ( wrapper . render ( ) ) . toMatchSnapshot ( ) ;
45
+ const { asFragment } = render ( component ) ;
46
+ expect ( asFragment ( ) ) . toMatchSnapshot ( ) ;
47
47
} ) ;
48
48
49
49
test ( 'size rate L; should create Label and Element with 33% and 66% width respectively and display: flex for top FormItem div' , ( ) => {
50
50
window = Object . assign ( window , { innerWidth : SIZE_L } ) ;
51
- const wrapper = mount ( component ) ;
52
- expect ( wrapper . render ( ) ) . toMatchSnapshot ( ) ;
51
+ const { asFragment } = render ( component ) ;
52
+ expect ( asFragment ( ) ) . toMatchSnapshot ( ) ;
53
53
} ) ;
54
54
55
55
test ( 'size rate XL; should create Label and Element with 33% and 66% width respectively and display: flex for top FormItem div' , ( ) => {
56
56
window = Object . assign ( window , { innerWidth : SIZE_XL } ) ;
57
- const wrapper = mount ( component ) ;
58
- expect ( wrapper . render ( ) ) . toMatchSnapshot ( ) ;
57
+ const { asFragment } = render ( component ) ;
58
+ expect ( asFragment ( ) ) . toMatchSnapshot ( ) ;
59
59
} ) ;
60
60
61
61
test ( "should use a single FormGroup's title as a Form title if one is not set" , ( ) => {
@@ -71,8 +71,8 @@ describe('Create a Form', () => {
71
71
</ FormGroup >
72
72
</ Form >
73
73
) ;
74
- const wrapper = mount ( ungroupedChildren ) ;
75
- expect ( wrapper . render ( ) ) . toMatchSnapshot ( ) ;
74
+ const { asFragment } = render ( ungroupedChildren ) ;
75
+ expect ( asFragment ( ) ) . toMatchSnapshot ( ) ;
76
76
} ) ;
77
77
78
78
createPassThroughPropsTest ( Form , {
0 commit comments