You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
828 B
26 lines
828 B
7 years ago
|
import React from 'react';
|
||
2 years ago
|
import type { ListProps } from '..';
|
||
7 years ago
|
import List from '..';
|
||
5 years ago
|
import mountTest from '../../../tests/shared/mountTest';
|
||
5 years ago
|
import rtlTest from '../../../tests/shared/rtlTest';
|
||
2 years ago
|
import { render } from '../../../tests/utils';
|
||
7 years ago
|
|
||
|
describe('List', () => {
|
||
5 years ago
|
mountTest(List);
|
||
|
mountTest(List.Item);
|
||
|
|
||
5 years ago
|
rtlTest(List);
|
||
|
rtlTest(List.Item);
|
||
|
|
||
7 years ago
|
it('locale not passed to internal div', async () => {
|
||
|
const locale = { emptyText: 'Custom text' };
|
||
2 years ago
|
const renderItem: ListProps<any>['renderItem'] = item => <List.Item>{item}</List.Item>;
|
||
|
const dataSource: ListProps<any>['dataSource'] = [];
|
||
7 years ago
|
|
||
3 years ago
|
const { container } = render(
|
||
|
<List renderItem={renderItem} dataSource={dataSource} locale={locale} />,
|
||
|
);
|
||
2 years ago
|
expect(container.querySelector('div.ant-list')?.getAttribute('locale')).toBe(null);
|
||
7 years ago
|
});
|
||
|
});
|