From b1c42a329261f985df9b162aec949725f89720ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E7=88=B1=E5=90=83=E7=99=BD=E8=90=9D?= =?UTF-8?q?=E5=8D=9C?= Date: Tue, 11 Apr 2023 11:47:38 +0800 Subject: [PATCH] test: Diff of React 17 & 18 (#41739) * test: prepare for 17 & 18 diff * test: prepare for 17 & 18 diff * test: update snapshot * test: fix arr check * test: update snapshot * test: update snapshot --- .../__snapshots__/setup.test.tsx.snap | 11 +++++ components/__tests__/setup.test.tsx | 14 +++++++ .../__snapshots__/components.test.tsx.snap | 42 +++++++++---------- .../__snapshots__/index.test.tsx.snap | 4 +- tests/setupAfterEnv.ts | 24 +++++++++-- 5 files changed, 69 insertions(+), 26 deletions(-) create mode 100644 components/__tests__/__snapshots__/setup.test.tsx.snap create mode 100644 components/__tests__/setup.test.tsx diff --git a/components/__tests__/__snapshots__/setup.test.tsx.snap b/components/__tests__/__snapshots__/setup.test.tsx.snap new file mode 100644 index 0000000000..f2e4db6141 --- /dev/null +++ b/components/__tests__/__snapshots__/setup.test.tsx.snap @@ -0,0 +1,11 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`SetUp.Test diff of React 18 & React 17 1`] = ` +NodeList [ +
+ bamboo + little +
, +
, +] +`; diff --git a/components/__tests__/setup.test.tsx b/components/__tests__/setup.test.tsx new file mode 100644 index 0000000000..f555f13ee6 --- /dev/null +++ b/components/__tests__/setup.test.tsx @@ -0,0 +1,14 @@ +import * as React from 'react'; +import { render } from '../../tests/utils'; + +describe('SetUp.Test', () => { + it('diff of React 18 & React 17', () => { + const { container } = render( + <> +
{['bamboo', '', 'little']}
+
{['', '']}
+ , + ); + expect(container.childNodes).toMatchSnapshot(); + }); +}); diff --git a/components/config-provider/__tests__/__snapshots__/components.test.tsx.snap b/components/config-provider/__tests__/__snapshots__/components.test.tsx.snap index cd9196fe5e..46ddf8c259 100644 --- a/components/config-provider/__tests__/__snapshots__/components.test.tsx.snap +++ b/components/config-provider/__tests__/__snapshots__/components.test.tsx.snap @@ -17661,7 +17661,7 @@ exports[`ConfigProvider components List prefixCls 1`] = ` `; exports[`ConfigProvider components Menu configProvider 1`] = ` -HTMLCollection [ +Array [