test: update test

This commit is contained in:
tangjinzhou 2021-12-24 16:45:10 +08:00
parent 73ebf4c518
commit e9c9fbae21
2 changed files with 137 additions and 127 deletions

View File

@ -3,134 +3,134 @@
exports[`antd dist files exports modules correctly 1`] = `
Array [
"default",
"install",
"install: { name: install }",
"version",
"Affix",
"Alert",
"Anchor",
"AnchorLink",
"AutoComplete",
"AutoCompleteOptGroup",
"AutoCompleteOption",
"Avatar",
"AvatarGroup",
"BackTop",
"Badge",
"BadgeRibbon",
"Breadcrumb",
"BreadcrumbItem",
"BreadcrumbSeparator",
"Button",
"ButtonGroup",
"Calendar",
"Card",
"CardGrid",
"CardMeta",
"Carousel",
"Cascader",
"CheckableTag",
"Checkbox",
"CheckboxGroup",
"Col",
"Collapse",
"CollapsePanel",
"Comment",
"ConfigProvider",
"DatePicker",
"Descriptions",
"DescriptionsItem",
"DirectoryTree",
"Divider",
"Drawer",
"Dropdown",
"DropdownButton",
"Empty",
"Form",
"FormItem",
"FormItemRest",
"Affix: { name: AAffix }",
"Alert: { name: AAlert }",
"Anchor: { name: AAnchor }",
"AnchorLink: { name: AAnchorLink }",
"AutoComplete: { name: AAutoComplete }",
"AutoCompleteOptGroup: { displayName: AAutoCompleteOptGroup }",
"AutoCompleteOption: { displayName: AAutoCompleteOption }",
"Avatar: { name: AAvatar }",
"AvatarGroup: { name: AAvatarGroup }",
"BackTop: { name: ABackTop }",
"Badge: { name: ABadge }",
"BadgeRibbon: { name: ABadgeRibbon }",
"Breadcrumb: { name: ABreadcrumb }",
"BreadcrumbItem: { name: ABreadcrumbItem }",
"BreadcrumbSeparator: { name: ABreadcrumbSeparator }",
"Button: { name: AButton }",
"ButtonGroup: { name: AButtonGroup }",
"Calendar: { name: ACalendar }",
"Card: { name: ACard }",
"CardGrid: { name: ACardGrid }",
"CardMeta: { name: ACardMeta }",
"Carousel: { name: ACarousel }",
"Cascader: { name: ACascader }",
"CheckableTag: { name: ACheckableTag }",
"Checkbox: { name: ACheckbox }",
"CheckboxGroup: { name: ACheckboxGroup }",
"Col: { name: ACol }",
"Collapse: { name: ACollapse }",
"CollapsePanel: { name: ACollapsePanel }",
"Comment: { name: AComment }",
"ConfigProvider: { name: AConfigProvider }",
"DatePicker: { name: ADatePicker }",
"Descriptions: { name: ADescriptions }",
"DescriptionsItem: { name: ADescriptionsItem }",
"DirectoryTree: { name: ADirectoryTree }",
"Divider: { name: ADivider }",
"Drawer: { name: ADrawer }",
"Dropdown: { name: ADropdown }",
"DropdownButton: { name: ADropdownButton }",
"Empty: { displayName: AEmpty }",
"Form: { name: AForm }",
"FormItem: { name: AFormItem }",
"FormItemRest: { name: AFormItemRest }",
"Grid",
"Image",
"ImagePreviewGroup",
"Input",
"InputGroup",
"InputNumber",
"InputPassword",
"InputSearch",
"Layout",
"LayoutContent",
"LayoutFooter",
"LayoutHeader",
"LayoutSider",
"List",
"ListItem",
"ListItemMeta",
"LocaleProvider",
"Mentions",
"MentionsOption",
"Menu",
"MenuDivider",
"MenuItem",
"MenuItemGroup",
"Modal",
"MonthPicker",
"PageHeader",
"Pagination",
"Popconfirm",
"Popover",
"Progress",
"QuarterPicker",
"Radio",
"RadioButton",
"RadioGroup",
"RangePicker",
"Rate",
"Result",
"Row",
"Select",
"SelectOptGroup",
"SelectOption",
"Skeleton",
"SkeletonAvatar",
"SkeletonButton",
"SkeletonImage",
"SkeletonInput",
"Slider",
"Space",
"Spin",
"Statistic",
"StatisticCountdown",
"Step",
"Steps",
"SubMenu",
"Switch",
"TabPane",
"Table",
"TableColumn",
"TableColumnGroup",
"TableSummary",
"TableSummaryCell",
"TableSummaryRow",
"Tabs",
"Tag",
"Textarea",
"TimePicker",
"TimeRangePicker",
"Timeline",
"TimelineItem",
"Tooltip",
"Transfer",
"Tree",
"TreeNode",
"TreeSelect",
"TreeSelectNode",
"Typography",
"TypographyLink",
"TypographyParagraph",
"TypographyText",
"TypographyTitle",
"Upload",
"UploadDragger",
"WeekPicker",
"Image: { name: AImage }",
"ImagePreviewGroup: { name: AImagePreviewGroup }",
"Input: { name: AInput }",
"InputGroup: { name: AInputGroup }",
"InputNumber: { name: AInputNumber }",
"InputPassword: { name: AInputPassword }",
"InputSearch: { name: AInputSearch }",
"Layout: { name: ALayout }",
"LayoutContent: { name: ALayoutContent }",
"LayoutFooter: { name: ALayoutFooter }",
"LayoutHeader: { name: ALayoutHeader }",
"LayoutSider: { name: ALayoutSider }",
"List: { name: AList }",
"ListItem: { name: AListItem }",
"ListItemMeta: { displayName: AListItemMeta }",
"LocaleProvider: { name: ALocaleProvider }",
"Mentions: { name: AMentions }",
"MentionsOption: { name: AMentionsOption }",
"Menu: { name: AMenu }",
"MenuDivider: { name: AMenuDivider }",
"MenuItem: { name: AMenuItem }",
"MenuItemGroup: { name: AMenuItemGroup }",
"Modal: { name: AModal }",
"MonthPicker: { name: AMonthPicker }",
"PageHeader: { name: APageHeader }",
"Pagination: { name: APagination }",
"Popconfirm: { name: APopconfirm }",
"Popover: { name: APopover }",
"Progress: { name: AProgress }",
"QuarterPicker: { name: AQuarterPicker }",
"Radio: { name: ARadio }",
"RadioButton: { name: ARadioButton }",
"RadioGroup: { name: ARadioGroup }",
"RangePicker: { name: ARangePicker }",
"Rate: { name: ARate }",
"Result: { name: AResult }",
"Row: { name: ARow }",
"Select: { name: ASelect }",
"SelectOptGroup: { displayName: ASelectOptGroup }",
"SelectOption: { displayName: ASelectOption }",
"Skeleton: { name: ASkeleton }",
"SkeletonAvatar: { name: ASkeletonAvatar }",
"SkeletonButton: { name: ASkeletonButton }",
"SkeletonImage: { name: ASkeletonImage }",
"SkeletonInput: { name: ASkeletonInput }",
"Slider: { name: ASlider }",
"Space: { name: ASpace }",
"Spin: { name: ASpin }",
"Statistic: { name: AStatistic }",
"StatisticCountdown: { name: AStatisticCountdown }",
"Step: { name: AStep }",
"Steps: { name: ASteps }",
"SubMenu: { name: ASubMenu }",
"Switch: { name: ASwitch }",
"TabPane: { name: ATabPane }",
"Table: { name: ATable }",
"TableColumn: { name: ATableColumn }",
"TableColumnGroup: { name: ATableColumnGroup }",
"TableSummary: { name: ATableSummary }",
"TableSummaryCell: { name: ATableSummaryCell }",
"TableSummaryRow: { name: ATableSummaryRow }",
"Tabs: { name: ATabs }",
"Tag: { name: ATag }",
"Textarea: { name: ATextarea }",
"TimePicker: { name: ATimePicker }",
"TimeRangePicker: { name: ATimeRangePicker }",
"Timeline: { name: ATimeline }",
"TimelineItem: { name: ATimelineItem }",
"Tooltip: { name: ATooltip }",
"Transfer: { name: ATransfer }",
"Tree: { name: ATree }",
"TreeNode: { name: ATreeNode }",
"TreeSelect: { name: ATreeSelect }",
"TreeSelectNode: { displayName: ATreeSelectNode }",
"Typography: { name: ATypography }",
"TypographyLink: { displayName: ATypographyLink }",
"TypographyParagraph: { displayName: ATypographyParagraph }",
"TypographyText: { displayName: ATypographyText }",
"TypographyTitle: { displayName: ATypographyTitle }",
"Upload: { name: AUpload }",
"UploadDragger: { name: AUploadDragger }",
"WeekPicker: { name: AWeekPicker }",
"message",
"notification",
]

View File

@ -7,7 +7,17 @@ describe('antd dist files', () => {
// https://github.com/ant-design/ant-design/issues/1968
it('exports modules correctly', () => {
const antd = testDist ? require('../dist/antd') : require('../components'); // eslint-disable-line global-require
expect(Object.keys(antd)).toMatchSnapshot();
expect(
Object.keys(antd).map(key => {
if (antd[key].displayName) {
return `${key}: { displayName: ${antd[key].displayName} }`;
}
if (antd[key].name) {
return `${key}: { name: ${antd[key].name} }`;
}
return key;
}),
).toMatchSnapshot();
});
// https://github.com/ant-design/ant-design/issues/1970