File tree 4 files changed +69
-1
lines changed
4 files changed +69
-1
lines changed Original file line number Diff line number Diff line change
1
+ import { shallow } from 'enzyme' ;
2
+ import React from 'react' ;
3
+ import Page from '@/components/Page' ;
4
+
5
+ describe ( 'Page test' , ( ) => {
6
+ it ( 'should render page' , ( ) => {
7
+ const container = shallow (
8
+ < Page >
9
+ Hello world
10
+ </ Page >
11
+ ) ;
12
+
13
+ expect ( container . find ( '.page' ) . length ) . toBe ( 1 ) ;
14
+ } ) ;
15
+
16
+ it ( 'should render page content' , ( ) => {
17
+ const container = shallow (
18
+ < Page . Content >
19
+ Hello world
20
+ </ Page . Content >
21
+ ) ;
22
+
23
+ expect ( container . find ( '.page-content' ) . length ) . toBe ( 1 ) ;
24
+ } ) ;
25
+
26
+ it ( 'should render page header' , ( ) => {
27
+ const container = shallow (
28
+ < Page . Header title = "Test" >
29
+ Hello world
30
+ </ Page . Header >
31
+ ) ;
32
+
33
+ expect ( container . find ( '.page-header' ) . length ) . toBe ( 1 ) ;
34
+ expect ( container . find ( '.page-header > .page-header-title' ) . length ) . toBe ( 1 ) ;
35
+ expect ( container . find ( '.page-header > .page-header-title' ) . text ( ) ) . toContain ( 'Test' )
36
+ } ) ;
37
+ } ) ;
Original file line number Diff line number Diff line change
1
+ import { shallow } from 'enzyme' ;
2
+ import React from 'react' ;
3
+ import Panel from '@/components/Panel' ;
4
+
5
+ describe ( 'Page test' , ( ) => {
6
+ it ( 'should render panel' , ( ) => {
7
+ const container = shallow (
8
+ < Panel >
9
+ Hello world
10
+ </ Panel >
11
+ ) ;
12
+
13
+ expect ( container . find ( '.panel' ) . length ) . toBe ( 1 ) ;
14
+ } ) ;
15
+
16
+ it ( 'should render spaced panel' , ( ) => {
17
+ const container = shallow (
18
+ < Panel spaced >
19
+ Hello world
20
+ </ Panel >
21
+ ) ;
22
+
23
+ expect ( container . find ( '.panel.panel-spaced' ) . length ) . toBe ( 1 ) ;
24
+ } ) ;
25
+ } ) ;
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ const PageHeader = ({
24
24
'page-header-title'
25
25
) }
26
26
>
27
- < h1 > { title } </ h1 >
27
+ { title }
28
28
</ div >
29
29
) }
30
30
{ children }
Original file line number Diff line number Diff line change
1
+ @use " ../base/mixins" ;
2
+
1
3
.page {
2
4
background : var (--page-background-color );
3
5
12
14
}
13
15
14
16
.page-header-title {
17
+ font-size : 2rem ;
18
+ color : mixins .color (' gray' , 900 );
19
+ font-weight : normal ;
20
+ margin : 0 ;
15
21
padding-bottom : var (--page-gutter );
16
22
}
17
23
}
You can’t perform that action at this time.
0 commit comments