mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 19:19:57 +08:00
fix test case
This commit is contained in:
parent
73562d878c
commit
7878fb6edc
@ -207,6 +207,23 @@ exports[`Calendar Calendar should support locale 1`] = `
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td
|
||||
class="ant-picker-cell"
|
||||
title="2018-09-30"
|
||||
>
|
||||
<div
|
||||
class="ant-picker-cell-inner ant-picker-calendar-date"
|
||||
>
|
||||
<div
|
||||
class="ant-picker-calendar-date-value"
|
||||
>
|
||||
30
|
||||
</div>
|
||||
<div
|
||||
class="ant-picker-calendar-date-content"
|
||||
/>
|
||||
</div>
|
||||
</td>
|
||||
<td
|
||||
class="ant-picker-cell ant-picker-cell-in-view"
|
||||
title="2018-10-01"
|
||||
@ -309,6 +326,8 @@ exports[`Calendar Calendar should support locale 1`] = `
|
||||
/>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td
|
||||
class="ant-picker-cell ant-picker-cell-in-view"
|
||||
title="2018-10-07"
|
||||
@ -326,8 +345,6 @@ exports[`Calendar Calendar should support locale 1`] = `
|
||||
/>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td
|
||||
class="ant-picker-cell ant-picker-cell-in-view"
|
||||
title="2018-10-08"
|
||||
@ -430,6 +447,8 @@ exports[`Calendar Calendar should support locale 1`] = `
|
||||
/>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td
|
||||
class="ant-picker-cell ant-picker-cell-in-view"
|
||||
title="2018-10-14"
|
||||
@ -447,8 +466,6 @@ exports[`Calendar Calendar should support locale 1`] = `
|
||||
/>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td
|
||||
class="ant-picker-cell ant-picker-cell-in-view"
|
||||
title="2018-10-15"
|
||||
@ -551,6 +568,8 @@ exports[`Calendar Calendar should support locale 1`] = `
|
||||
/>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td
|
||||
class="ant-picker-cell ant-picker-cell-in-view"
|
||||
title="2018-10-21"
|
||||
@ -568,8 +587,6 @@ exports[`Calendar Calendar should support locale 1`] = `
|
||||
/>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td
|
||||
class="ant-picker-cell ant-picker-cell-in-view"
|
||||
title="2018-10-22"
|
||||
@ -672,6 +689,8 @@ exports[`Calendar Calendar should support locale 1`] = `
|
||||
/>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td
|
||||
class="ant-picker-cell ant-picker-cell-in-view"
|
||||
title="2018-10-28"
|
||||
@ -689,8 +708,6 @@ exports[`Calendar Calendar should support locale 1`] = `
|
||||
/>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td
|
||||
class="ant-picker-cell ant-picker-cell-in-view"
|
||||
title="2018-10-29"
|
||||
@ -793,6 +810,8 @@ exports[`Calendar Calendar should support locale 1`] = `
|
||||
/>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td
|
||||
class="ant-picker-cell"
|
||||
title="2018-11-04"
|
||||
@ -810,8 +829,6 @@ exports[`Calendar Calendar should support locale 1`] = `
|
||||
/>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td
|
||||
class="ant-picker-cell"
|
||||
title="2018-11-05"
|
||||
@ -914,23 +931,6 @@ exports[`Calendar Calendar should support locale 1`] = `
|
||||
/>
|
||||
</div>
|
||||
</td>
|
||||
<td
|
||||
class="ant-picker-cell"
|
||||
title="2018-11-11"
|
||||
>
|
||||
<div
|
||||
class="ant-picker-cell-inner ant-picker-calendar-date"
|
||||
>
|
||||
<div
|
||||
class="ant-picker-calendar-date-value"
|
||||
>
|
||||
11
|
||||
</div>
|
||||
<div
|
||||
class="ant-picker-calendar-date-content"
|
||||
/>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -769,6 +769,16 @@ Array [
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td
|
||||
class="ant-picker-cell"
|
||||
title="1999-12-26"
|
||||
>
|
||||
<div
|
||||
class="ant-picker-cell-inner"
|
||||
>
|
||||
26
|
||||
</div>
|
||||
</td>
|
||||
<td
|
||||
class="ant-picker-cell"
|
||||
title="1999-12-27"
|
||||
@ -829,6 +839,8 @@ Array [
|
||||
1
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td
|
||||
class="ant-picker-cell ant-picker-cell-in-view"
|
||||
title="2000-01-02"
|
||||
@ -839,8 +851,6 @@ Array [
|
||||
2
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td
|
||||
class="ant-picker-cell ant-picker-cell-in-view"
|
||||
title="2000-01-03"
|
||||
@ -901,6 +911,8 @@ Array [
|
||||
8
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td
|
||||
class="ant-picker-cell ant-picker-cell-in-view"
|
||||
title="2000-01-09"
|
||||
@ -911,8 +923,6 @@ Array [
|
||||
9
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td
|
||||
class="ant-picker-cell ant-picker-cell-in-view"
|
||||
title="2000-01-10"
|
||||
@ -973,6 +983,8 @@ Array [
|
||||
15
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td
|
||||
class="ant-picker-cell ant-picker-cell-in-view"
|
||||
title="2000-01-16"
|
||||
@ -983,8 +995,6 @@ Array [
|
||||
16
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td
|
||||
class="ant-picker-cell ant-picker-cell-in-view"
|
||||
title="2000-01-17"
|
||||
@ -1045,6 +1055,8 @@ Array [
|
||||
22
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td
|
||||
class="ant-picker-cell ant-picker-cell-in-view"
|
||||
title="2000-01-23"
|
||||
@ -1055,8 +1067,6 @@ Array [
|
||||
23
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td
|
||||
class="ant-picker-cell ant-picker-cell-in-view"
|
||||
title="2000-01-24"
|
||||
@ -1117,6 +1127,8 @@ Array [
|
||||
29
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td
|
||||
class="ant-picker-cell ant-picker-cell-in-view"
|
||||
title="2000-01-30"
|
||||
@ -1127,8 +1139,6 @@ Array [
|
||||
30
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td
|
||||
class="ant-picker-cell ant-picker-cell-in-view"
|
||||
title="2000-01-31"
|
||||
@ -1189,16 +1199,6 @@ Array [
|
||||
5
|
||||
</div>
|
||||
</td>
|
||||
<td
|
||||
class="ant-picker-cell"
|
||||
title="2000-02-06"
|
||||
>
|
||||
<div
|
||||
class="ant-picker-cell-inner"
|
||||
>
|
||||
6
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -304,16 +304,6 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
>
|
||||
1
|
||||
</td>
|
||||
<td
|
||||
class="ant-picker-cell"
|
||||
title="1999-12-26"
|
||||
>
|
||||
<div
|
||||
class="ant-picker-cell-inner"
|
||||
>
|
||||
26
|
||||
</div>
|
||||
</td>
|
||||
<td
|
||||
class="ant-picker-cell"
|
||||
title="1999-12-27"
|
||||
@ -374,15 +364,6 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
1
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr
|
||||
class="ant-picker-week-panel-row"
|
||||
>
|
||||
<td
|
||||
class="ant-picker-cell ant-picker-cell-week"
|
||||
>
|
||||
2
|
||||
</td>
|
||||
<td
|
||||
class="ant-picker-cell ant-picker-cell-in-view"
|
||||
title="2000-01-02"
|
||||
@ -393,6 +374,15 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
2
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr
|
||||
class="ant-picker-week-panel-row"
|
||||
>
|
||||
<td
|
||||
class="ant-picker-cell ant-picker-cell-week"
|
||||
>
|
||||
2
|
||||
</td>
|
||||
<td
|
||||
class="ant-picker-cell ant-picker-cell-in-view"
|
||||
title="2000-01-03"
|
||||
@ -453,15 +443,6 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
8
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr
|
||||
class="ant-picker-week-panel-row"
|
||||
>
|
||||
<td
|
||||
class="ant-picker-cell ant-picker-cell-week"
|
||||
>
|
||||
3
|
||||
</td>
|
||||
<td
|
||||
class="ant-picker-cell ant-picker-cell-in-view"
|
||||
title="2000-01-09"
|
||||
@ -472,6 +453,15 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
9
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr
|
||||
class="ant-picker-week-panel-row"
|
||||
>
|
||||
<td
|
||||
class="ant-picker-cell ant-picker-cell-week"
|
||||
>
|
||||
3
|
||||
</td>
|
||||
<td
|
||||
class="ant-picker-cell ant-picker-cell-in-view"
|
||||
title="2000-01-10"
|
||||
@ -532,15 +522,6 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
15
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr
|
||||
class="ant-picker-week-panel-row"
|
||||
>
|
||||
<td
|
||||
class="ant-picker-cell ant-picker-cell-week"
|
||||
>
|
||||
4
|
||||
</td>
|
||||
<td
|
||||
class="ant-picker-cell ant-picker-cell-in-view"
|
||||
title="2000-01-16"
|
||||
@ -551,6 +532,15 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
16
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr
|
||||
class="ant-picker-week-panel-row"
|
||||
>
|
||||
<td
|
||||
class="ant-picker-cell ant-picker-cell-week"
|
||||
>
|
||||
4
|
||||
</td>
|
||||
<td
|
||||
class="ant-picker-cell ant-picker-cell-in-view"
|
||||
title="2000-01-17"
|
||||
@ -611,15 +601,6 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
22
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr
|
||||
class="ant-picker-week-panel-row"
|
||||
>
|
||||
<td
|
||||
class="ant-picker-cell ant-picker-cell-week"
|
||||
>
|
||||
5
|
||||
</td>
|
||||
<td
|
||||
class="ant-picker-cell ant-picker-cell-in-view"
|
||||
title="2000-01-23"
|
||||
@ -630,6 +611,15 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
23
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr
|
||||
class="ant-picker-week-panel-row"
|
||||
>
|
||||
<td
|
||||
class="ant-picker-cell ant-picker-cell-week"
|
||||
>
|
||||
5
|
||||
</td>
|
||||
<td
|
||||
class="ant-picker-cell ant-picker-cell-in-view"
|
||||
title="2000-01-24"
|
||||
@ -690,15 +680,6 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
29
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr
|
||||
class="ant-picker-week-panel-row"
|
||||
>
|
||||
<td
|
||||
class="ant-picker-cell ant-picker-cell-week"
|
||||
>
|
||||
6
|
||||
</td>
|
||||
<td
|
||||
class="ant-picker-cell ant-picker-cell-in-view"
|
||||
title="2000-01-30"
|
||||
@ -709,6 +690,15 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
30
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr
|
||||
class="ant-picker-week-panel-row"
|
||||
>
|
||||
<td
|
||||
class="ant-picker-cell ant-picker-cell-week"
|
||||
>
|
||||
6
|
||||
</td>
|
||||
<td
|
||||
class="ant-picker-cell ant-picker-cell-in-view"
|
||||
title="2000-01-31"
|
||||
@ -769,6 +759,16 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
5
|
||||
</div>
|
||||
</td>
|
||||
<td
|
||||
class="ant-picker-cell"
|
||||
title="2000-02-06"
|
||||
>
|
||||
<div
|
||||
class="ant-picker-cell-inner"
|
||||
>
|
||||
6
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -213,7 +213,7 @@ describe('Table.filter', () => {
|
||||
|
||||
expect(wrapper.find('FilterDropdown').props().filterState.filteredKeys).toBeFalsy();
|
||||
wrapper.find('FilterDropdown').find('input[type="checkbox"]').first().simulate('click');
|
||||
wrapper.find('FilterDropdown').find('.confirm').simulate('click');
|
||||
wrapper.find('FilterDropdown').find('.ant-table-filter-dropdown-btns .ant-btn-primary').simulate('click');
|
||||
expect(wrapper.find('FilterDropdown').props().filterState.filteredKeys).toEqual(['boy']);
|
||||
wrapper.setProps({ dataSource: [...data, { key: 999, name: 'Chris' }] });
|
||||
expect(wrapper.find('FilterDropdown').props().filterState.filteredKeys).toEqual(['boy']);
|
||||
@ -344,7 +344,7 @@ describe('Table.filter', () => {
|
||||
wrapper.find('.ant-dropdown-trigger').first().simulate('click');
|
||||
|
||||
wrapper.find('FilterDropdown').find('MenuItem').first().simulate('click');
|
||||
wrapper.find('FilterDropdown').find('.confirm').simulate('click');
|
||||
wrapper.find('FilterDropdown').find('.ant-table-filter-dropdown-btns .ant-btn-primary').simulate('click');
|
||||
|
||||
expect(handleChange).toHaveBeenCalledWith(
|
||||
{},
|
||||
@ -361,7 +361,7 @@ describe('Table.filter', () => {
|
||||
const wrapper = mount(createTable({ onChange: handleChange }));
|
||||
|
||||
wrapper.find('.ant-dropdown-trigger').first().simulate('click');
|
||||
wrapper.find('.clear').simulate('click');
|
||||
wrapper.find('.ant-table-filter-dropdown-btns .ant-btn-link').simulate('click');
|
||||
|
||||
expect(handleChange).not.toHaveBeenCalled();
|
||||
});
|
||||
@ -515,7 +515,7 @@ describe('Table.filter', () => {
|
||||
wrapper.find('.ant-dropdown-trigger').first().simulate('click');
|
||||
|
||||
wrapper.find('MenuItem').first().simulate('click');
|
||||
wrapper.find('.confirm').simulate('click');
|
||||
wrapper.find('.ant-table-filter-dropdown-btns .ant-btn-primary').simulate('click');
|
||||
wrapper.update();
|
||||
expect(renderedNames(wrapper)).toEqual(['Jack']);
|
||||
|
||||
@ -761,7 +761,7 @@ describe('Table.filter', () => {
|
||||
|
||||
wrapper.find('.ant-dropdown-trigger').first().simulate('click');
|
||||
wrapper.find('MenuItem').first().simulate('click');
|
||||
wrapper.find('.confirm').simulate('click');
|
||||
wrapper.find('.ant-table-filter-dropdown-btns .ant-btn-primary').simulate('click');
|
||||
expect(onChange).toHaveBeenCalled();
|
||||
onChange.mockReset();
|
||||
expect(onChange).not.toHaveBeenCalled();
|
||||
@ -776,7 +776,7 @@ describe('Table.filter', () => {
|
||||
});
|
||||
|
||||
wrapper.find('MenuItem').first().simulate('click');
|
||||
wrapper.find('.confirm').simulate('click');
|
||||
wrapper.find('.ant-table-filter-dropdown-btns .ant-btn-primary').simulate('click');
|
||||
expect(onChange).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
@ -899,7 +899,7 @@ describe('Table.filter', () => {
|
||||
|
||||
wrapper.find('.ant-dropdown-trigger').first().simulate('click');
|
||||
wrapper.find('MenuItem').first().simulate('click');
|
||||
wrapper.find('.confirm').simulate('click');
|
||||
wrapper.find('.ant-table-filter-dropdown-btns .ant-btn-primary').simulate('click');
|
||||
|
||||
expect(handleChange).toHaveBeenCalledWith(
|
||||
{
|
||||
@ -930,7 +930,7 @@ describe('Table.filter', () => {
|
||||
|
||||
wrapper.find('.ant-dropdown-trigger').first().simulate('click');
|
||||
wrapper.find('MenuItem').first().simulate('click');
|
||||
wrapper.find('.confirm').simulate('click');
|
||||
wrapper.find('.ant-table-filter-dropdown-btns .ant-btn-primary').simulate('click');
|
||||
|
||||
expect(handleChange).toHaveBeenCalledWith(
|
||||
{
|
||||
@ -1020,7 +1020,7 @@ describe('Table.filter', () => {
|
||||
onChange.mockReset();
|
||||
wrapper.find('span.ant-dropdown-trigger').simulate('click', nativeEvent);
|
||||
wrapper.find('.ant-dropdown-menu-item').first().simulate('click');
|
||||
wrapper.find('.ant-table-filter-dropdown-link.confirm').simulate('click');
|
||||
wrapper.find('.ant-table-filter-dropdown-btns .ant-btn-primary').simulate('click');
|
||||
expect(onChange).toHaveBeenCalledWith(
|
||||
expect.anything(),
|
||||
{
|
||||
@ -1050,8 +1050,15 @@ describe('Table.filter', () => {
|
||||
}),
|
||||
);
|
||||
|
||||
expect(wrapper.find('.ant-table-filter-dropdown-link').first().text()).toEqual('Bamboo');
|
||||
expect(wrapper.find('.ant-table-filter-dropdown-link').last().text()).toEqual('Reset');
|
||||
expect(wrapper.find('.ant-table-filter-dropdown-btns .ant-btn-primary').text()).toEqual(
|
||||
'Bamboo',
|
||||
);
|
||||
expect(
|
||||
wrapper
|
||||
.find('.ant-table-filter-dropdown-btns .ant-btn-link')
|
||||
.last()
|
||||
.text(),
|
||||
).toEqual('Reset');
|
||||
});
|
||||
|
||||
it('filtered should work', () => {
|
||||
|
@ -12277,7 +12277,9 @@ exports[`renders ./components/table/demo/row-selection-custom-debug.md correctly
|
||||
/>
|
||||
<col />
|
||||
</colgroup>
|
||||
<thead>
|
||||
<thead
|
||||
class="ant-table-thead"
|
||||
>
|
||||
<tr>
|
||||
<th
|
||||
class="ant-table-cell ant-table-selection-column"
|
||||
|
Loading…
Reference in New Issue
Block a user