@@ -15,49 +15,49 @@ test('test chip plugin', () => {
15
15
expect ( Vue . component ( Chip . name ) ) . toBeTruthy ( )
16
16
} )
17
17
18
- // test('test chip color & textColor', () => {
19
- // const wrapper = mount(VarChip, {
20
- // propsData: {
21
- // color: '#000',
22
- // textColor: '#000',
23
- // },
24
- // })
25
-
26
- // expect(wrapper.html()).toMatchSnapshot()
27
- // })
28
-
29
- // test('test chip close', () => {
30
- // const onClose = jest.fn()
31
-
32
- // const wrapper = mount(VarChip, {
33
- // propsData: {
34
- // closable: true,
35
- // },
36
- // listeners: {
37
- // close: onClose,
38
- // },
39
- // })
40
-
41
- // const closeEl = wrapper.find('.var-chip--close')
42
- // expect(closeEl.exists()).toBe(true)
43
- // closeEl.trigger('click')
44
- // expect(onClose).toHaveBeenCalledTimes(1)
45
- // })
46
-
47
- // test('test chip styles', () => {
48
- // const wrapper = mount(VarChip, {
49
- // propsData: {
50
- // closable: true,
51
- // size: 'large',
52
- // round: true,
53
- // plain: true,
54
- // block: true,
55
- // iconName: 'fire',
56
- // },
57
- // scopedSlots: {
58
- // default: '<div>chip text</div>',
59
- // },
60
- // })
61
-
62
- // expect(wrapper.html()).toMatchSnapshot()
63
- // })
18
+ test ( 'test chip color & textColor' , ( ) => {
19
+ const wrapper = mount ( VarChip , {
20
+ propsData : {
21
+ color : '#000' ,
22
+ textColor : '#000' ,
23
+ } ,
24
+ } )
25
+
26
+ expect ( wrapper . html ( ) ) . toMatchSnapshot ( )
27
+ } )
28
+
29
+ test ( 'test chip close' , ( ) => {
30
+ const onClose = jest . fn ( )
31
+
32
+ const wrapper = mount ( VarChip , {
33
+ propsData : {
34
+ closable : true ,
35
+ } ,
36
+ listeners : {
37
+ close : onClose ,
38
+ } ,
39
+ } )
40
+
41
+ const closeEl = wrapper . find ( '.var-chip--close' )
42
+ expect ( closeEl . exists ( ) ) . toBe ( true )
43
+ closeEl . trigger ( 'click' )
44
+ expect ( onClose ) . toHaveBeenCalledTimes ( 1 )
45
+ } )
46
+
47
+ test ( 'test chip styles' , ( ) => {
48
+ const wrapper = mount ( VarChip , {
49
+ propsData : {
50
+ closable : true ,
51
+ size : 'large' ,
52
+ round : true ,
53
+ plain : true ,
54
+ block : true ,
55
+ iconName : 'fire' ,
56
+ } ,
57
+ scopedSlots : {
58
+ default : '<div>chip text</div>' ,
59
+ } ,
60
+ } )
61
+
62
+ expect ( wrapper . html ( ) ) . toMatchSnapshot ( )
63
+ } )
0 commit comments