Skip to content
This repository was archived by the owner on Jan 8, 2025. It is now read-only.

Commit 6f53d7f

Browse files
committed
feat(ui/chip): update snap
1 parent ab6a957 commit 6f53d7f

File tree

2 files changed

+53
-46
lines changed

2 files changed

+53
-46
lines changed

packages/varlet-vue2-ui/src/chip/__tests__/__snapshots__/index.spec.js.snap

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3+
exports[`test chip color & textColor 1`] = `
4+
"<transition-stub name=\\"var-fade\\"><span class=\\"var-chip var--box var-chip--normal var--inline-flex var-chip--default var-chip--round\\" style=\\"color: rgb(0, 0, 0); background: rgb(0, 0, 0);\\"> <span class=\\"var-chip--text-normal\\"></span>
5+
<!----></span></transition-stub>"
6+
`;
7+
38
exports[`test chip example 1`] = `
49
"<div class=\\"var-chip-example\\">
510
<div class=\\"app-type\\">纸片类型</div>
@@ -63,3 +68,5 @@ exports[`test chip example 1`] = `
6368
<!----></span></transition-stub>
6469
</div>"
6570
`;
71+
72+
exports[`test chip styles 1`] = `"<transition-stub name=\\"var-fade\\"><span class=\\"var-chip var--box var-chip--large var--flex var-chip--plain var-chip--plain-default var-chip--round\\"> <span class=\\"var-chip--text-large\\"><div>chip text</div></span> <span class=\\"var-chip--close\\"><i class=\\"var-icon var-icon--set var-icon-fire\\" style=\\"transition: transform 0ms;\\"></i></span></span></transition-stub>"`;

packages/varlet-vue2-ui/src/chip/__tests__/index.spec.js

+46-46
Original file line numberDiff line numberDiff line change
@@ -15,49 +15,49 @@ test('test chip plugin', () => {
1515
expect(Vue.component(Chip.name)).toBeTruthy()
1616
})
1717

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

Comments
 (0)