From be25ee2a0b4b0a34e5fbf0347fe27740726a673f Mon Sep 17 00:00:00 2001 From: lijianan <574980606@qq.com> Date: Wed, 22 Feb 2023 19:49:06 +0800 Subject: [PATCH] test: simplify rtlTest test case (#40878) --- components/calendar/__tests__/index.test.tsx | 6 +- .../__snapshots__/index.test.tsx.snap | 94 +++++++++---------- components/menu/__tests__/index.test.tsx | 6 +- tests/shared/rtlTest.tsx | 20 ++-- 4 files changed, 57 insertions(+), 69 deletions(-) diff --git a/components/calendar/__tests__/index.test.tsx b/components/calendar/__tests__/index.test.tsx index 04594c0d55..a41fd78020 100644 --- a/components/calendar/__tests__/index.test.tsx +++ b/components/calendar/__tests__/index.test.tsx @@ -1,9 +1,9 @@ -import MockDate from 'mockdate'; import Dayjs from 'dayjs'; import 'dayjs/locale/zh-cn'; +import MockDate from 'mockdate'; +import { type PickerPanelProps } from 'rc-picker'; import dayjsGenerateConfig from 'rc-picker/lib/generate/dayjs'; import type { Locale } from 'rc-picker/lib/interface'; -import { type PickerPanelProps } from 'rc-picker'; import React from 'react'; import Calendar from '..'; import mountTest from '../../../tests/shared/mountTest'; @@ -42,7 +42,7 @@ jest.mock('rc-picker', () => { describe('Calendar', () => { mountTest(Calendar); - rtlTest(Calendar, { mockDate: true }); + rtlTest(Calendar, true); function openSelect(wrapper: HTMLElement, className: string) { fireEvent.mouseDown(wrapper.querySelector(className)!.querySelector('.ant-select-selector')!); diff --git a/components/menu/__tests__/__snapshots__/index.test.tsx.snap b/components/menu/__tests__/__snapshots__/index.test.tsx.snap index 1017654498..0e1cfde9d6 100644 --- a/components/menu/__tests__/__snapshots__/index.test.tsx.snap +++ b/components/menu/__tests__/__snapshots__/index.test.tsx.snap @@ -329,64 +329,58 @@ exports[`Menu all types must be available in the "items" syntax 1`] = ` `; exports[`Menu rtl render component should be rendered correctly in RTL direction 1`] = ` -HTMLCollection [ -