@@ -5,7 +5,7 @@ import SectionHeadingRenderer from './SectionHeadingRenderer';
5
5
describe ( 'SectionHeading' , ( ) => {
6
6
const FakeToolbar = ( ) => < div > Fake toolbar</ div > ;
7
7
8
- it ( 'should forward slot properties to the toolbar' , ( ) => {
8
+ test ( 'should forward slot properties to the toolbar' , ( ) => {
9
9
const actual = shallow (
10
10
< SectionHeading id = "section" slotName = "slot" slotProps = { { foo : 1 , bar : 'baz' } } depth = { 2 } >
11
11
A Section
@@ -15,18 +15,18 @@ describe('SectionHeading', () => {
15
15
expect ( actual ) . toMatchSnapshot ( ) ;
16
16
} ) ;
17
17
18
- it ( 'should render a section heading', ( ) => {
19
- const actual = shallow (
18
+ test ( ' render a section heading', ( ) => {
19
+ const actual = mount (
20
20
< SectionHeadingRenderer id = "section" href = "/section" depth = { 2 } toolbar = { < FakeToolbar /> } >
21
21
A Section
22
22
</ SectionHeadingRenderer >
23
23
) ;
24
24
25
- expect ( actual . dive ( ) ) . toMatchSnapshot ( ) ;
25
+ expect ( actual . find ( 'h2' ) ) . toMatchSnapshot ( ) ;
26
26
} ) ;
27
27
28
- it ( 'should render a deprecated section heading', ( ) => {
29
- const actual = shallow (
28
+ test ( ' render a deprecated section heading', ( ) => {
29
+ const actual = mount (
30
30
< SectionHeadingRenderer
31
31
id = "section"
32
32
href = "/section"
@@ -38,25 +38,20 @@ describe('SectionHeading', () => {
38
38
</ SectionHeadingRenderer >
39
39
) ;
40
40
41
- expect ( actual . dive ( ) ) . toMatchSnapshot ( ) ;
41
+ expect ( actual . find ( 'h2' ) ) . toMatchSnapshot ( ) ;
42
42
} ) ;
43
43
44
- it ( 'should prevent the heading level from exceeding the maximum allowed by the Heading component', ( ) => {
45
- const actual = shallow (
44
+ test ( ' prevent the heading level from exceeding the maximum allowed by the Heading component', ( ) => {
45
+ const actual = mount (
46
46
< SectionHeadingRenderer id = "section" href = "/section" depth = { 7 } toolbar = { < FakeToolbar /> } >
47
47
A Section
48
48
</ SectionHeadingRenderer >
49
49
) ;
50
50
51
- expect (
52
- actual
53
- . dive ( )
54
- . find ( 'Styled(Heading)' )
55
- . prop ( 'level' )
56
- ) . toEqual ( 6 ) ;
51
+ expect ( actual . find ( 'h6' ) ) . toHaveLength ( 1 ) ;
57
52
} ) ;
58
53
59
- it ( 'should the href have a parameter id=section', ( ) => {
54
+ test ( ' the href have id=section query parameter ', ( ) => {
60
55
const actual = shallow (
61
56
< SectionHeading
62
57
id = "section"
@@ -69,11 +64,6 @@ describe('SectionHeading', () => {
69
64
</ SectionHeading >
70
65
) ;
71
66
72
- expect (
73
- actual
74
- . dive ( )
75
- . find ( 'SectionHeadingRenderer' )
76
- . prop ( 'href' )
77
- ) . toEqual ( 'blank?id=section' ) ;
67
+ expect ( actual . prop ( 'href' ) ) . toEqual ( '/?id=section' ) ;
78
68
} ) ;
79
69
} ) ;
0 commit comments