ant-design/components/date-picker/__tests__/demo.test.tsx
dingkang d57c86d92c
feat: migrate less to token for DatePicker (#42607)
* feat: migrate less to token for time-picker

* feat: add component-token demo

* feat:update token with  API Naming rules

* feat: migrate less to token for Time-pikker

* chore: code clean

* chore: code clean

* chore: udpate

* feat: picker token

* chore: add comment

---------

Co-authored-by: MadCcc <1075746765@qq.com>
2023-08-22 16:28:20 +08:00

20 lines
683 B
TypeScript

import dayjs from 'dayjs';
import * as React from 'react';
import demoTest, { rootPropsTest } from '../../../tests/shared/demoTest';
demoTest('date-picker', { skip: ['locale.tsx', 'component-token.tsx'], testRootProps: false });
rootPropsTest('date-picker', (DatePicker, props) => <DatePicker {...props} value={dayjs()} />, {
findRootElements: () => document.querySelectorAll('.ant-picker, .ant-picker-dropdown'),
expectCount: 2,
});
rootPropsTest(
'date-picker',
(DatePicker, props) => <DatePicker.RangePicker {...props} value={dayjs()} />,
{
findRootElements: () => document.querySelectorAll('.ant-picker-range, .ant-picker-dropdown'),
expectCount: 2,
},
);