2019-01-12 03:33:27 +00:00
|
|
|
import { mount } from '@vue/test-utils';
|
|
|
|
import { asyncExpect } from '@/tests/utils';
|
|
|
|
import List from '..';
|
2018-09-11 01:14:57 +00:00
|
|
|
|
|
|
|
describe('List', () => {
|
|
|
|
it('locale not passed to internal div', async () => {
|
2019-01-12 03:33:27 +00:00
|
|
|
const locale = { emptyText: 'Custom text' };
|
|
|
|
const wrapper = mount(
|
|
|
|
{
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<List
|
|
|
|
dataSource={[]}
|
|
|
|
renderItem={item => <List.Item>{item}</List.Item>}
|
|
|
|
locale={locale}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
},
|
2018-09-11 01:14:57 +00:00
|
|
|
},
|
2019-01-12 03:33:27 +00:00
|
|
|
{
|
|
|
|
sync: false,
|
|
|
|
},
|
|
|
|
);
|
2018-09-11 01:14:57 +00:00
|
|
|
await asyncExpect(() => {
|
2019-01-12 03:33:27 +00:00
|
|
|
expect(wrapper.props().locale).toBe(undefined);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|