@@ -4,26 +4,24 @@ import { CAvatar as Component } from '../../../index'
44const ComponentName = 'CAvatar'
55
66const defaultWrapper = mount ( Component , {
7- propsData : {
8-
9- } ,
7+ propsData : { } ,
108 slots : {
119 default : 'Default slot' ,
12- }
10+ } ,
1311} )
1412
1513const customWrapper = mount ( Component , {
16- propsData : {
17- color : 'warning' ,
18- shape : 'rounded-bottom' ,
19- size : 'md' ,
20- src : '/bazinga' ,
21- status : 'danger' ,
22- textColor : 'light'
23- } ,
24- slots : {
25- default : 'Default slot' ,
26- }
14+ propsData : {
15+ color : 'warning' ,
16+ shape : 'rounded-bottom' ,
17+ size : 'md' ,
18+ src : '/bazinga' ,
19+ status : 'danger' ,
20+ textColor : 'light' ,
21+ } ,
22+ slots : {
23+ default : 'Default slot' ,
24+ } ,
2725} )
2826
2927describe ( `Loads and display ${ ComponentName } component` , ( ) => {
@@ -32,28 +30,28 @@ describe(`Loads and display ${ComponentName} component`, () => {
3230 } )
3331 it ( 'renders correctly' , ( ) => {
3432 expect ( defaultWrapper . html ( ) ) . toMatchSnapshot ( )
35- } )
33+ } )
3634 it ( 'contain slots and classes' , ( ) => {
3735 expect ( defaultWrapper . text ( ) ) . toContain ( 'Default slot' )
3836 expect ( defaultWrapper . classes ( 'avatar' ) ) . toBe ( true )
3937 } )
4038} )
4139
4240describe ( `Loads and display ${ ComponentName } component` , ( ) => {
43- it ( 'has a name' , ( ) => {
44- expect ( Component . name ) . toMatch ( ComponentName )
45- } )
46- it ( 'renders correctly' , ( ) => {
47- expect ( customWrapper . html ( ) ) . toMatchSnapshot ( )
48- } )
49- it ( 'contain slots and classes' , ( ) => {
50- expect ( customWrapper . classes ( 'avatar' ) ) . toBe ( true )
51- expect ( customWrapper . classes ( 'bg-warning' ) ) . toBe ( true )
52- expect ( customWrapper . classes ( 'avatar-md' ) ) . toBe ( true )
53- expect ( customWrapper . classes ( 'text-light' ) ) . toBe ( true )
54- expect ( customWrapper . find ( 'img' ) . classes ( 'avatar-img' ) ) . toBe ( true )
55- expect ( customWrapper . find ( 'img' ) . attributes ( 'src' ) ) . toBe ( '/bazinga' )
56- expect ( customWrapper . find ( 'span' ) . classes ( 'avatar-status' ) ) . toBe ( true )
57- expect ( customWrapper . find ( 'span' ) . classes ( 'bg-danger' ) ) . toBe ( true )
58- } )
59- } )
41+ it ( 'has a name' , ( ) => {
42+ expect ( Component . name ) . toMatch ( ComponentName )
43+ } )
44+ it ( 'renders correctly' , ( ) => {
45+ expect ( customWrapper . html ( ) ) . toMatchSnapshot ( )
46+ } )
47+ it ( 'contain slots and classes' , ( ) => {
48+ expect ( customWrapper . classes ( 'avatar' ) ) . toBe ( true )
49+ expect ( customWrapper . classes ( 'bg-warning' ) ) . toBe ( true )
50+ expect ( customWrapper . classes ( 'avatar-md' ) ) . toBe ( true )
51+ expect ( customWrapper . classes ( 'text-light' ) ) . toBe ( true )
52+ expect ( customWrapper . find ( 'img' ) . classes ( 'avatar-img' ) ) . toBe ( true )
53+ expect ( customWrapper . find ( 'img' ) . attributes ( 'src' ) ) . toBe ( '/bazinga' )
54+ expect ( customWrapper . find ( 'span' ) . classes ( 'avatar-status' ) ) . toBe ( true )
55+ expect ( customWrapper . find ( 'span' ) . classes ( 'bg-danger' ) ) . toBe ( true )
56+ } )
57+ } )
0 commit comments