mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-08 01:53:34 +08:00
This diff excludes `locale` from `rest` variable to avoid passing to div. Close #10123
This commit is contained in:
parent
05a522c343
commit
c0e60f8097
18
components/list/__tests__/index.test.js
Normal file
18
components/list/__tests__/index.test.js
Normal file
@ -0,0 +1,18 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import List from '..';
|
||||
|
||||
const ListItem = List.Item;
|
||||
|
||||
describe('List', () => {
|
||||
it('locale not passed to internal div', async () => {
|
||||
const locale = { emptyText: 'Custom text' };
|
||||
const renderItem = item => <ListItem>{item}</ListItem>;
|
||||
const dataSource = [];
|
||||
|
||||
const wrapper = mount(
|
||||
<List renderItem={renderItem} dataSource={dataSource} locale={locale} />
|
||||
);
|
||||
expect(wrapper.find('div').first().props().locale).toBe(undefined);
|
||||
});
|
||||
});
|
@ -129,6 +129,7 @@ export default class List extends React.Component<ListProps> {
|
||||
header,
|
||||
footer,
|
||||
loading,
|
||||
locale,
|
||||
...rest,
|
||||
} = this.props;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user