chore: update Item component test case (#34686)

Co-authored-by: Zack Chang <zackchangjx@foxmail.com>
This commit is contained in:
Zack Chang 2022-03-24 14:27:42 +08:00 committed by GitHub
parent 35aa951550
commit 5e0c232077
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 50 additions and 118 deletions

View File

@ -151,7 +151,7 @@ describe('List Item Layout', () => {
renderItem={item => <List.Item>{item.title}</List.Item>}
/>,
);
expect(wrapper).toMatchSnapshot();
expect(wrapper.render()).toMatchSnapshot();
});
it('rowKey could be function', () => {
@ -176,6 +176,6 @@ describe('List Item Layout', () => {
renderItem={item => <List.Item>{item.title}</List.Item>}
/>,
);
expect(wrapper).toMatchSnapshot();
expect(wrapper.render()).toMatchSnapshot();
});
});

View File

@ -58,139 +58,71 @@ exports[`List Item Layout horizontal itemLayout List should accept extra node 1`
`;
exports[`List Item Layout rowKey could be function 1`] = `
<List
dataSource={
Array [
Object {
"id": 1,
"title": "ant design",
},
Object {
"id": 2,
"title": "ant design",
},
Object {
"id": 3,
"title": "ant design",
},
]
}
renderItem={[Function]}
rowKey={[Function]}
<div
class="ant-list ant-list-split"
>
<div
className="ant-list ant-list-split"
class="ant-spin-nested-loading"
>
<Spin
size="default"
spinning={false}
wrapperClassName=""
<div
class="ant-spin-container"
>
<div
className="ant-spin-nested-loading"
<ul
class="ant-list-items"
>
<div
className="ant-spin-container"
key="container"
<li
class="ant-list-item"
>
<ul
className="ant-list-items"
>
<Item>
<li
className="ant-list-item"
>
ant design
</li>
</Item>
<Item>
<li
className="ant-list-item"
>
ant design
</li>
</Item>
<Item>
<li
className="ant-list-item"
>
ant design
</li>
</Item>
</ul>
</div>
</div>
</Spin>
ant design
</li>
<li
class="ant-list-item"
>
ant design
</li>
<li
class="ant-list-item"
>
ant design
</li>
</ul>
</div>
</div>
</List>
</div>
`;
exports[`List Item Layout rowKey could be string 1`] = `
<List
dataSource={
Array [
Object {
"id": 1,
"title": "ant design",
},
Object {
"id": 2,
"title": "ant design",
},
Object {
"id": 3,
"title": "ant design",
},
]
}
renderItem={[Function]}
rowKey="id"
<div
class="ant-list ant-list-split"
>
<div
className="ant-list ant-list-split"
class="ant-spin-nested-loading"
>
<Spin
size="default"
spinning={false}
wrapperClassName=""
<div
class="ant-spin-container"
>
<div
className="ant-spin-nested-loading"
<ul
class="ant-list-items"
>
<div
className="ant-spin-container"
key="container"
<li
class="ant-list-item"
>
<ul
className="ant-list-items"
>
<Item>
<li
className="ant-list-item"
>
ant design
</li>
</Item>
<Item>
<li
className="ant-list-item"
>
ant design
</li>
</Item>
<Item>
<li
className="ant-list-item"
>
ant design
</li>
</Item>
</ul>
</div>
</div>
</Spin>
ant design
</li>
<li
class="ant-list-item"
>
ant design
</li>
<li
class="ant-list-item"
>
ant design
</li>
</ul>
</div>
</div>
</List>
</div>
`;
exports[`List Item Layout should render in RTL direction 1`] = `