fix snapshot and test case

This commit is contained in:
afc163 2019-07-30 11:58:45 +08:00
parent f15c08a898
commit 4374514252
8 changed files with 136 additions and 136 deletions

View File

@ -12542,46 +12542,46 @@ exports[`ConfigProvider components Tabs prefixCls 1`] = `
exports[`ConfigProvider components Tags configProvider 1`] = `
<div>
<div
<span
class="config-tag"
>
Bamboo
</div>
<div
</span>
<span
class="config-tag config-tag-checkable"
>
Light
</div>
</span>
</div>
`;
exports[`ConfigProvider components Tags normal 1`] = `
<div>
<div
<span
class="ant-tag"
>
Bamboo
</div>
<div
</span>
<span
class="ant-tag ant-tag-checkable"
>
Light
</div>
</span>
</div>
`;
exports[`ConfigProvider components Tags prefixCls 1`] = `
<div>
<div
<span
class="prefix-Tags"
>
Bamboo
</div>
<div
</span>
<span
class="prefix-Tags prefix-Tags-checkable"
>
Light
</div>
</span>
</div>
`;

View File

@ -3043,11 +3043,11 @@ exports[`RangePicker switch to corresponding month panel when click presetted ra
<div
class="ant-calendar-footer-extra ant-calendar-range-quick-selector"
>
<div
<span
class="ant-tag ant-tag-blue"
>
My Birthday
</div>
</span>
</div>
<a
class="ant-calendar-time-picker-btn"

View File

@ -54,11 +54,11 @@ exports[`renders ./components/page-header/demo/actions.md correctly 1`] = `
<span
class="ant-page-header-heading-tags"
>
<div
<span
class="ant-tag ant-tag-red"
>
Warning
</div>
</span>
</span>
<span
class="ant-page-header-heading-extra"

View File

@ -350,16 +350,16 @@ exports[`renders ./components/table/demo/basic.md correctly 1`] = `
class=""
>
<span>
<div
<span
class="ant-tag ant-tag-green"
>
NICE
</div>
<div
</span>
<span
class="ant-tag ant-tag-geekblue"
>
DEVELOPER
</div>
</span>
</span>
</td>
<td
@ -413,11 +413,11 @@ exports[`renders ./components/table/demo/basic.md correctly 1`] = `
class=""
>
<span>
<div
<span
class="ant-tag ant-tag-volcano"
>
LOSER
</div>
</span>
</span>
</td>
<td
@ -471,16 +471,16 @@ exports[`renders ./components/table/demo/basic.md correctly 1`] = `
class=""
>
<span>
<div
<span
class="ant-tag ant-tag-green"
>
COOL
</div>
<div
</span>
<span
class="ant-tag ant-tag-geekblue"
>
TEACHER
</div>
</span>
</span>
</td>
<td
@ -10912,16 +10912,16 @@ exports[`renders ./components/table/demo/jsx.md correctly 1`] = `
class=""
>
<span>
<div
<span
class="ant-tag ant-tag-blue"
>
nice
</div>
<div
</span>
<span
class="ant-tag ant-tag-blue"
>
developer
</div>
</span>
</span>
</td>
<td
@ -10976,11 +10976,11 @@ exports[`renders ./components/table/demo/jsx.md correctly 1`] = `
class=""
>
<span>
<div
<span
class="ant-tag ant-tag-blue"
>
loser
</div>
</span>
</span>
</td>
<td
@ -11035,16 +11035,16 @@ exports[`renders ./components/table/demo/jsx.md correctly 1`] = `
class=""
>
<span>
<div
<span
class="ant-tag ant-tag-blue"
>
cool
</div>
<div
</span>
<span
class="ant-tag ant-tag-blue"
>
teacher
</div>
</span>
</span>
</td>
<td

View File

@ -9,7 +9,7 @@ exports[`renders ./components/tag/demo/animation.md correctly 1`] = `
<span
style="display:inline-block"
>
<div
<span
class="ant-tag"
>
Tag 1
@ -33,12 +33,12 @@ exports[`renders ./components/tag/demo/animation.md correctly 1`] = `
/>
</svg>
</i>
</div>
</span>
</span>
<span
style="display:inline-block"
>
<div
<span
class="ant-tag"
>
Tag 2
@ -62,12 +62,12 @@ exports[`renders ./components/tag/demo/animation.md correctly 1`] = `
/>
</svg>
</i>
</div>
</span>
</span>
<span
style="display:inline-block"
>
<div
<span
class="ant-tag"
>
Tag 3
@ -91,11 +91,11 @@ exports[`renders ./components/tag/demo/animation.md correctly 1`] = `
/>
</svg>
</i>
</div>
</span>
</span>
</div>
</div>
<div
<span
class="ant-tag"
style="background:#fff;border-style:dashed"
>
@ -122,18 +122,18 @@ exports[`renders ./components/tag/demo/animation.md correctly 1`] = `
</svg>
</i>
New Tag
</div>
</span>
</div>
`;
exports[`renders ./components/tag/demo/basic.md correctly 1`] = `
<div>
<div
<span
class="ant-tag"
>
Tag 1
</div>
<div
</span>
<span
class="ant-tag"
>
<a
@ -141,8 +141,8 @@ exports[`renders ./components/tag/demo/basic.md correctly 1`] = `
>
Link
</a>
</div>
<div
</span>
<span
class="ant-tag"
>
Tag 2
@ -166,8 +166,8 @@ exports[`renders ./components/tag/demo/basic.md correctly 1`] = `
/>
</svg>
</i>
</div>
<div
</span>
<span
class="ant-tag"
>
Prevent Default
@ -191,27 +191,27 @@ exports[`renders ./components/tag/demo/basic.md correctly 1`] = `
/>
</svg>
</i>
</div>
</span>
</div>
`;
exports[`renders ./components/tag/demo/checkable.md correctly 1`] = `
<div>
<div
<span
class="ant-tag ant-tag-checkable ant-tag-checkable-checked"
>
Tag1
</div>
<div
</span>
<span
class="ant-tag ant-tag-checkable ant-tag-checkable-checked"
>
Tag2
</div>
<div
</span>
<span
class="ant-tag ant-tag-checkable ant-tag-checkable-checked"
>
Tag3
</div>
</span>
</div>
`;
@ -223,61 +223,61 @@ exports[`renders ./components/tag/demo/colorful.md correctly 1`] = `
Presets:
</h4>
<div>
<div
<span
class="ant-tag ant-tag-magenta"
>
magenta
</div>
<div
</span>
<span
class="ant-tag ant-tag-red"
>
red
</div>
<div
</span>
<span
class="ant-tag ant-tag-volcano"
>
volcano
</div>
<div
</span>
<span
class="ant-tag ant-tag-orange"
>
orange
</div>
<div
</span>
<span
class="ant-tag ant-tag-gold"
>
gold
</div>
<div
</span>
<span
class="ant-tag ant-tag-lime"
>
lime
</div>
<div
</span>
<span
class="ant-tag ant-tag-green"
>
green
</div>
<div
</span>
<span
class="ant-tag ant-tag-cyan"
>
cyan
</div>
<div
</span>
<span
class="ant-tag ant-tag-blue"
>
blue
</div>
<div
</span>
<span
class="ant-tag ant-tag-geekblue"
>
geekblue
</div>
<div
</span>
<span
class="ant-tag ant-tag-purple"
>
purple
</div>
</span>
</div>
<h4
style="margin:16px 0"
@ -285,42 +285,42 @@ exports[`renders ./components/tag/demo/colorful.md correctly 1`] = `
Custom:
</h4>
<div>
<div
<span
class="ant-tag ant-tag-has-color"
style="background-color:#f50"
>
#f50
</div>
<div
</span>
<span
class="ant-tag ant-tag-has-color"
style="background-color:#2db7f5"
>
#2db7f5
</div>
<div
</span>
<span
class="ant-tag ant-tag-has-color"
style="background-color:#87d068"
>
#87d068
</div>
<div
</span>
<span
class="ant-tag ant-tag-has-color"
style="background-color:#108ee9"
>
#108ee9
</div>
</span>
</div>
</div>
`;
exports[`renders ./components/tag/demo/control.md correctly 1`] = `
<div>
<div
<span
class="ant-tag"
>
Unremovable
</div>
<div
</span>
<span
class="ant-tag"
>
Tag 2
@ -344,8 +344,8 @@ exports[`renders ./components/tag/demo/control.md correctly 1`] = `
/>
</svg>
</i>
</div>
<div
</span>
<span
class="ant-tag"
>
Tag 3
@ -369,8 +369,8 @@ exports[`renders ./components/tag/demo/control.md correctly 1`] = `
/>
</svg>
</i>
</div>
<div
</span>
<span
class="ant-tag"
style="background:#fff;border-style:dashed"
>
@ -397,13 +397,13 @@ exports[`renders ./components/tag/demo/control.md correctly 1`] = `
</svg>
</i>
New Tag
</div>
</span>
</div>
`;
exports[`renders ./components/tag/demo/controlled.md correctly 1`] = `
<div>
<div
<span
class="ant-tag"
>
Movies
@ -427,7 +427,7 @@ exports[`renders ./components/tag/demo/controlled.md correctly 1`] = `
/>
</svg>
</i>
</div>
</span>
<br />
<button
class="ant-btn ant-btn-sm"
@ -447,25 +447,25 @@ exports[`renders ./components/tag/demo/hot-tags.md correctly 1`] = `
>
Categories:
</h6>
<div
<span
class="ant-tag ant-tag-checkable"
>
Movies
</div>
<div
</span>
<span
class="ant-tag ant-tag-checkable"
>
Books
</div>
<div
</span>
<span
class="ant-tag ant-tag-checkable"
>
Music
</div>
<div
</span>
<span
class="ant-tag ant-tag-checkable"
>
Sports
</div>
</span>
</div>
`;

View File

@ -1,37 +1,37 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Tag visibility can be controlled by visible with hidden as initial value 1`] = `
<div
<span
class="ant-tag ant-tag-hidden"
/>
`;
exports[`Tag visibility can be controlled by visible with hidden as initial value 2`] = `
<div
<span
class="ant-tag"
/>
`;
exports[`Tag visibility can be controlled by visible with hidden as initial value 3`] = `
<div
<span
class="ant-tag ant-tag-hidden"
/>
`;
exports[`Tag visibility can be controlled by visible with visible as initial value 1`] = `
<div
<span
class="ant-tag"
/>
`;
exports[`Tag visibility can be controlled by visible with visible as initial value 2`] = `
<div
<span
class="ant-tag ant-tag-hidden"
/>
`;
exports[`Tag visibility can be controlled by visible with visible as initial value 3`] = `
<div
<span
class="ant-tag"
/>
`;

View File

@ -15,12 +15,12 @@ describe('Tag', () => {
const onClose = jest.fn();
const wrapper = mount(<Tag closable onClose={onClose} />);
expect(wrapper.find('.anticon-close').length).toBe(1);
expect(wrapper.find('div.ant-tag:not(.ant-tag-hidden)').length).toBe(1);
expect(wrapper.find('.ant-tag:not(.ant-tag-hidden)').length).toBe(1);
wrapper.find('.anticon-close').simulate('click');
expect(onClose).toHaveBeenCalled();
jest.runAllTimers();
wrapper.update();
expect(wrapper.find('div.ant-tag:not(.ant-tag-hidden)').length).toBe(0);
expect(wrapper.find('.ant-tag:not(.ant-tag-hidden)').length).toBe(0);
});
it('should not be closed when prevent default', () => {
@ -29,10 +29,10 @@ describe('Tag', () => {
};
const wrapper = mount(<Tag closable onClose={onClose} />);
expect(wrapper.find('.anticon-close').length).toBe(1);
expect(wrapper.find('div.ant-tag:not(.ant-tag-hidden)').length).toBe(1);
expect(wrapper.find('.ant-tag:not(.ant-tag-hidden)').length).toBe(1);
wrapper.find('.anticon-close').simulate('click');
jest.runAllTimers();
expect(wrapper.find('div.ant-tag:not(.ant-tag-hidden)').length).toBe(1);
expect(wrapper.find('.ant-tag:not(.ant-tag-hidden)').length).toBe(1);
});
describe('visibility', () => {

View File

@ -1320,11 +1320,11 @@ exports[`renders ./components/transfer/demo/table-transfer.md correctly 1`] = `
<td
class=""
>
<div
<span
class="ant-tag"
>
cat
</div>
</span>
</td>
<td
class=""
@ -1369,11 +1369,11 @@ exports[`renders ./components/transfer/demo/table-transfer.md correctly 1`] = `
<td
class=""
>
<div
<span
class="ant-tag"
>
dog
</div>
</span>
</td>
<td
class=""
@ -1418,11 +1418,11 @@ exports[`renders ./components/transfer/demo/table-transfer.md correctly 1`] = `
<td
class=""
>
<div
<span
class="ant-tag"
>
cat
</div>
</span>
</td>
<td
class=""
@ -1468,11 +1468,11 @@ exports[`renders ./components/transfer/demo/table-transfer.md correctly 1`] = `
<td
class=""
>
<div
<span
class="ant-tag"
>
dog
</div>
</span>
</td>
<td
class=""
@ -1517,11 +1517,11 @@ exports[`renders ./components/transfer/demo/table-transfer.md correctly 1`] = `
<td
class=""
>
<div
<span
class="ant-tag"
>
cat
</div>
</span>
</td>
<td
class=""
@ -1566,11 +1566,11 @@ exports[`renders ./components/transfer/demo/table-transfer.md correctly 1`] = `
<td
class=""
>
<div
<span
class="ant-tag"
>
dog
</div>
</span>
</td>
<td
class=""
@ -1615,11 +1615,11 @@ exports[`renders ./components/transfer/demo/table-transfer.md correctly 1`] = `
<td
class=""
>
<div
<span
class="ant-tag"
>
cat
</div>
</span>
</td>
<td
class=""
@ -1664,11 +1664,11 @@ exports[`renders ./components/transfer/demo/table-transfer.md correctly 1`] = `
<td
class=""
>
<div
<span
class="ant-tag"
>
dog
</div>
</span>
</td>
<td
class=""
@ -1714,11 +1714,11 @@ exports[`renders ./components/transfer/demo/table-transfer.md correctly 1`] = `
<td
class=""
>
<div
<span
class="ant-tag"
>
cat
</div>
</span>
</td>
<td
class=""
@ -1763,11 +1763,11 @@ exports[`renders ./components/transfer/demo/table-transfer.md correctly 1`] = `
<td
class=""
>
<div
<span
class="ant-tag"
>
dog
</div>
</span>
</td>
<td
class=""