From c01c1b505b57ef01f9da29b185d4e9096fea1137 Mon Sep 17 00:00:00 2001 From: lijianan <574980606@qq.com> Date: Tue, 5 Mar 2024 17:23:47 +0800 Subject: [PATCH] =?UTF-8?q?demo:=20update=20Grid=E3=80=81Table=E3=80=81Sel?= =?UTF-8?q?ect=20demo=20(#47709)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * demo: update demo * fix: fix test * feat: table snap --------- Co-authored-by: 叶枫 <645381995@qq.com> --- .../__snapshots__/demo-extend.test.ts.snap | 10 +- .../__tests__/__snapshots__/demo.test.ts.snap | 10 +- components/grid/demo/useBreakpoint.tsx | 11 +- .../__snapshots__/demo-extend.test.ts.snap | 32 +++-- .../__snapshots__/demo.test.tsx.snap | 12 +- components/select/demo/custom-tag-render.tsx | 9 +- .../__snapshots__/demo-extend.test.ts.snap | 130 +++++++++++------- .../__tests__/__snapshots__/demo.test.ts.snap | 130 +++++++++++------- components/table/demo/basic.tsx | 8 +- components/table/demo/jsx.tsx | 22 +-- components/table/demo/pagination.tsx | 8 +- 11 files changed, 233 insertions(+), 149 deletions(-) diff --git a/components/grid/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/grid/__tests__/__snapshots__/demo-extend.test.ts.snap index 62d97b5865de..bc365b9f129a 100644 --- a/components/grid/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/grid/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -1500,14 +1500,16 @@ exports[`renders components/grid/demo/sort.tsx extend context correctly 1`] = ` exports[`renders components/grid/demo/sort.tsx extend context correctly 2`] = `[]`; exports[`renders components/grid/demo/useBreakpoint.tsx extend context correctly 1`] = ` -Array [ - Current break point: , +
+ Current break point: xs - , -] + +
`; exports[`renders components/grid/demo/useBreakpoint.tsx extend context correctly 2`] = `[]`; diff --git a/components/grid/__tests__/__snapshots__/demo.test.ts.snap b/components/grid/__tests__/__snapshots__/demo.test.ts.snap index ea31e061cc3c..d55d0afdb9d8 100644 --- a/components/grid/__tests__/__snapshots__/demo.test.ts.snap +++ b/components/grid/__tests__/__snapshots__/demo.test.ts.snap @@ -1419,9 +1419,9 @@ exports[`renders components/grid/demo/sort.tsx correctly 1`] = ` `; exports[`renders components/grid/demo/useBreakpoint.tsx correctly 1`] = ` -Array [ - Current break point:, - , - , -] +
+ Current break point: +
`; diff --git a/components/grid/demo/useBreakpoint.tsx b/components/grid/demo/useBreakpoint.tsx index 90baf90e245f..160233c51d32 100644 --- a/components/grid/demo/useBreakpoint.tsx +++ b/components/grid/demo/useBreakpoint.tsx @@ -1,22 +1,21 @@ import React from 'react'; -import { Grid, Tag } from 'antd'; +import { Flex, Grid, Tag } from 'antd'; const { useBreakpoint } = Grid; const App: React.FC = () => { const screens = useBreakpoint(); - return ( - <> - Current break point:{' '} + + Current break point: {Object.entries(screens) .filter((screen) => !!screen[1]) - .map((screen) => ( + .map((screen) => ( {screen[0]} ))} - + ); }; diff --git a/components/select/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/select/__tests__/__snapshots__/demo-extend.test.ts.snap index 9b3737c359a3..5cce851ef818 100644 --- a/components/select/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/select/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -1522,9 +1522,11 @@ exports[`renders components/select/demo/custom-tag-render.tsx extend context cor - gold + + gold + - cyan + + cyan +
- gold + + gold +