diff --git a/components/list/__tests__/index.test.js b/components/list/__tests__/index.test.js new file mode 100644 index 0000000000..8947299973 --- /dev/null +++ b/components/list/__tests__/index.test.js @@ -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 => {item}; + const dataSource = []; + + const wrapper = mount( + + ); + expect(wrapper.find('div').first().props().locale).toBe(undefined); + }); +}); diff --git a/components/list/index.tsx b/components/list/index.tsx index 863e7d18ae..7a6f4f6cb4 100644 --- a/components/list/index.tsx +++ b/components/list/index.tsx @@ -129,6 +129,7 @@ export default class List extends React.Component { header, footer, loading, + locale, ...rest, } = this.props;