File tree Expand file tree Collapse file tree 12 files changed +262
-0
lines changed Expand file tree Collapse file tree 12 files changed +262
-0
lines changed Original file line number Diff line number Diff line change
1
+ import { mount } from '@vue/test-utils'
2
+ import Component from "../CCard" ;
3
+ const ComponentName = 'CCard'
4
+
5
+ const wrapper = mount ( Component , {
6
+ context : {
7
+ props : {
8
+ align : 'left' ,
9
+ variant : 'success' ,
10
+ textVariant : 'white' ,
11
+ borderVariant : 'solid' ,
12
+ header : 'header' ,
13
+ footer : 'footer' ,
14
+ body : 'body'
15
+ }
16
+ }
17
+ } )
18
+ const slotWrapper = mount ( Component , {
19
+ context : {
20
+ props : {
21
+ align : 'left' ,
22
+ variant : 'success' ,
23
+ textVariant : 'white' ,
24
+ borderVariant : 'solid' ,
25
+ header : 'header' ,
26
+ footer : 'footer' ,
27
+ body : 'body'
28
+ }
29
+ } ,
30
+ slots : {
31
+ header : 'this should overwrite header<br>' ,
32
+ default : 'this should overwrite body<br>' ,
33
+ footer : 'this should overwrite footer'
34
+ }
35
+ } )
36
+
37
+ describe ( ComponentName , ( ) => {
38
+ it ( 'has a name' , ( ) => {
39
+ expect ( Component . name ) . toMatch ( ComponentName )
40
+ } )
41
+ it ( 'renders correctly' , ( ) => {
42
+ expect ( wrapper . element ) . toMatchSnapshot ( )
43
+ } )
44
+ it ( 'renders correctly with slots' , ( ) => {
45
+ expect ( slotWrapper . element ) . toMatchSnapshot ( )
46
+ } )
47
+ } ) ;
Original file line number Diff line number Diff line change
1
+ import { mount } from '@vue/test-utils'
2
+ import Component from "../CCardBody" ;
3
+
4
+ const ComponentName = 'CCardBody'
5
+ const wrapper = mount ( Component , {
6
+ context : {
7
+ props : {
8
+ align : 'left' ,
9
+ variant : 'primary' ,
10
+ textVariant : 'white' ,
11
+ borderVariant : 'solid' ,
12
+ title : 'title' ,
13
+ subtitle : 'subtitle'
14
+ }
15
+ }
16
+ } )
17
+
18
+ describe ( ComponentName , ( ) => {
19
+ it ( 'has a name' , ( ) => {
20
+ expect ( Component . name ) . toMatch ( ComponentName )
21
+ } )
22
+ it ( 'renders correctly' , ( ) => {
23
+ expect ( wrapper . element ) . toMatchSnapshot ( )
24
+ } )
25
+ } ) ;
Original file line number Diff line number Diff line change
1
+ import { mount } from '@vue/test-utils'
2
+ import Component from "../CCardFooter" ;
3
+
4
+ const ComponentName = 'CCardFooter'
5
+ const wrapper = mount ( Component , {
6
+ context : {
7
+ props : {
8
+ align : 'left' ,
9
+ variant : 'primary' ,
10
+ textVariant : 'white' ,
11
+ borderVariant : 'solid'
12
+ }
13
+ } ,
14
+ slots : {
15
+ default : 'content goes here'
16
+ }
17
+ } )
18
+
19
+ describe ( ComponentName , ( ) => {
20
+ it ( 'has a name' , ( ) => {
21
+ expect ( Component . name ) . toMatch ( ComponentName )
22
+ } )
23
+ it ( 'renders correctly' , ( ) => {
24
+ expect ( wrapper . element ) . toMatchSnapshot ( )
25
+ } )
26
+ } ) ;
Original file line number Diff line number Diff line change
1
+ import { mount } from '@vue/test-utils'
2
+ import Component from "../CCardGroup" ;
3
+ const ComponentName = 'CCardGroup'
4
+ const wrapper = mount ( Component , {
5
+ context : {
6
+ props : {
7
+ deck : true ,
8
+ column : true ,
9
+ tag : 'p'
10
+ }
11
+ } ,
12
+ slots : {
13
+ default : 'content goes here'
14
+ }
15
+ } )
16
+
17
+ describe ( ComponentName , ( ) => {
18
+ it ( 'has a name' , ( ) => {
19
+ expect ( Component . name ) . toMatch ( ComponentName )
20
+ } )
21
+ it ( 'renders correctly' , ( ) => {
22
+ expect ( wrapper . element ) . toMatchSnapshot ( )
23
+ } )
24
+ } ) ;
Original file line number Diff line number Diff line change
1
+ import { mount } from '@vue/test-utils'
2
+ import Component from "../CCardHeader" ;
3
+ const ComponentName = 'CCardHeader'
4
+ const wrapper = mount ( Component , {
5
+ context : {
6
+ props : {
7
+ header : 'header' ,
8
+ align : 'left' ,
9
+ variant : 'primary' ,
10
+ textVariant : 'white' ,
11
+ borderVariant : 'solid'
12
+ }
13
+ } ,
14
+ slots : {
15
+ default : 'content goes here'
16
+ }
17
+ } )
18
+
19
+ describe ( ComponentName , ( ) => {
20
+ it ( 'has a name' , ( ) => {
21
+ expect ( Component . name ) . toMatch ( ComponentName )
22
+ } )
23
+ it ( 'renders correctly' , ( ) => {
24
+ expect ( wrapper . element ) . toMatchSnapshot ( )
25
+ } )
26
+ } ) ;
Original file line number Diff line number Diff line change
1
+ import { mount } from '@vue/test-utils'
2
+ import Component from "../CCardImg" ;
3
+ const ComponentName = 'CCardImg'
4
+ const wrapper = mount ( Component , {
5
+ context : {
6
+ props : {
7
+ src : 'some_src'
8
+ }
9
+ }
10
+ } )
11
+
12
+ describe ( ComponentName , ( ) => {
13
+ it ( 'has a name' , ( ) => {
14
+ expect ( Component . name ) . toMatch ( ComponentName )
15
+ } )
16
+ it ( 'renders correctly' , ( ) => {
17
+ expect ( wrapper . element ) . toMatchSnapshot ( )
18
+ } )
19
+ } ) ;
Original file line number Diff line number Diff line change
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports [` CCard renders correctly 1` ] = `
4
+ <div
5
+ class = " card text-left bg-success border-solid text-white"
6
+ >
7
+ <div
8
+ class = " card-header"
9
+ >
10
+ header
11
+ </div >
12
+ <div
13
+ class = " card-body"
14
+ >
15
+ <!---->
16
+ <!---->
17
+ body
18
+ </div >
19
+ <div
20
+ class = " card-footer"
21
+ >
22
+ footer
23
+ </div >
24
+ </div >
25
+ ` ;
26
+
27
+ exports [` CCard renders correctly with slots 1` ] = `
28
+ <div
29
+ class = " card text-left bg-success border-solid text-white"
30
+ >
31
+ this should overwrite header
32
+ <br />
33
+ this should overwrite body
34
+ <br />
35
+ this should overwrite footer
36
+ </div >
37
+ ` ;
Original file line number Diff line number Diff line change
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports [` CCardBody renders correctly 1` ] = `
4
+ <div
5
+ class = " card-body bg-primary border-solid text-white"
6
+ >
7
+ <h4
8
+ class = " card-title"
9
+ >
10
+ title
11
+ </h4 >
12
+ <h6
13
+ class = " card-subtitle mb-2 text-muted"
14
+ >
15
+ subtitle
16
+ </h6 >
17
+ </div >
18
+ ` ;
Original file line number Diff line number Diff line change
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports [` CCardFooter renders correctly 1` ] = `
4
+ <div
5
+ class = " card-footer text-left bg-primary border-solid text-white"
6
+ >
7
+ <template >
8
+ content goes here
9
+ </template >
10
+ </div >
11
+ ` ;
Original file line number Diff line number Diff line change
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports [` CCardGroup renders correctly 1` ] = `
4
+ <p
5
+ class = " card-deck"
6
+ >
7
+ <template >
8
+ content goes here
9
+ </template >
10
+ </p >
11
+ ` ;
You can’t perform that action at this time.
0 commit comments