From 8ca118fd4171e15a752322034c6e6e61cb6046cb Mon Sep 17 00:00:00 2001 From: Rush <84793349+zhuba-Ahhh@users.noreply.github.com> Date: Fri, 10 May 2024 08:22:12 +0800 Subject: [PATCH] chore(descriptions): Reveal the key to prevent errors (#8394) * chore(ProDescriptions): Reveal the key to prevent errors * chore(test): update snapshots * chore(test): Remove useless tests --- packages/descriptions/src/index.tsx | 1 + tests/card/__snapshots__/demo.test.ts.snap | 3560 +++++++++++++++---- tests/form/base.test.tsx | 12 - tests/table/__snapshots__/demo.test.ts.snap | 690 ++++ 4 files changed, 3600 insertions(+), 663 deletions(-) diff --git a/packages/descriptions/src/index.tsx b/packages/descriptions/src/index.tsx index fc7368a3f149..0e8fb56a25d6 100644 --- a/packages/descriptions/src/index.tsx +++ b/packages/descriptions/src/index.tsx @@ -404,6 +404,7 @@ const schemaToDescriptionsItem = ( 📸 renders ./packages/card/src/components/CheckCard/demo `; +exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demos/avatar.tsx correctly 2`] = ` + +
+
+ test +
+
+
+
+ + + + + +
+
+
+
+
+ 示例标题 +
+
+
+
+
+
+
+
+`; + exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demos/basic.tsx correctly 1`] = `
📸 renders ./packages/card/src/components/CheckCard/demo `; +exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demos/basic.tsx correctly 2`] = ` + +
+
+ test +
+
+
+
+ + + +
+
+
+
+
+ 示例一 +
+
+
+
+ 选择一个由流程编排提供的典型用户案例,可以从中学习到流程编排很多设计理念。 +
+
+
+
+
+
+`; + exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demos/compose.tsx correctly 1`] = `
📸 renders ./packages/card/src/components/CheckCard/demo `; -exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demos/custom.tsx correctly 1`] = ` +exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demos/compose.tsx correctly 2`] = `
📸 renders ./packages/card/src/components/CheckCard/demo
test
+

+ 只有图片时 +

-
-
-
- Card title -
-
-
-
- This is the description -
+ +
-
-
-`; - -exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demos/defaultChecked.tsx correctly 1`] = ` - -
-
- test -
+

+ 只有图片和描述时 +

📸 renders ./packages/card/src/components/CheckCard/demo class="ant-pro-checkcard-detail" >
-
-
- 示例二 -
-
+ 选择一个由流程编排提供的典型用户案例,可以从中学习到流程编排很多设计理念。
-
-
-`; - -exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demos/description.tsx correctly 1`] = ` - -
-
- test -
+

+ 只有标题和描述时 +

-
- - - -
@@ -435,32 +508,28 @@ exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demo class="ant-pro-checkcard-header-left" >
- 默认描述区域不会进行折行 + 示例
- - 选择一个由流程编排提供的典型用户案例,可以从中学习到流程编排很多设计理念。 - - 查看详情 - - + 选择一个由流程编排提供的典型用户案例,可以从中学习到流程编排很多设计理念。
+

+ 只有标题和图片 +

📸 renders ./packages/card/src/components/CheckCard/demo class="ant-pro-checkcard-header-left" >
- 你可以通过排版组件进行省略 + 示例
+
+
+ +

+ 只有标题 +

+
+
+
- 选择一个由流程编排提供的典型用户案例,可以从中学习到流程编排很多设计理念。 +
+ 示例 +
- -
-`; - -exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demos/disabled.tsx correctly 1`] = ` - -
-
- test -
-
-

- 部分不可用 -

+

+ 只有描述时 +

+
- - - -
-
-
-
-
- Card title -
-
-
-
- This is the description -
+ 选择一个由流程编排提供的典型用户案例,可以从中学习到流程编排很多设计理念。
+
+
+ +`; + +exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demos/custom.tsx correctly 1`] = ` + +
+
+ test +
+
- - - -
-
-
- Card title -
+ Card title
-
- This is the description -
-
-
-
-
-
-
- - -
-
-
-
- Card title -
-
-
-
- This is the description -
+ This is the description
+
+
+`; + +exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demos/custom.tsx correctly 2`] = ` + +
-

- 整体不可用 -

+ test +
+
-
-
- Card A -
-
-
-
- 选项一 + Card title
-
-
-
-
-
-
- Card B -
-
-
-
- 选项二 -
-
+ This is the description
@@ -718,7 +700,7 @@ exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demo `; -exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demos/extra.tsx correctly 1`] = ` +exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demos/defaultChecked.tsx correctly 1`] = `
📸 renders ./packages/card/src/components/CheckCard/demo test
📸 renders ./packages/card/src/components/CheckCard/demo
- 示例一 + 示例二
-
- - - -
-
-
- 选择一个由流程编排提供的典型用户案例,可以从中学习到流程编排很多设计理念。
@@ -797,7 +749,7 @@ exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demo `; -exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demos/form.tsx correctly 1`] = ` +exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demos/defaultChecked.tsx correctly 2`] = `
📸 renders ./packages/card/src/components/CheckCard/demo
test
-
-
-
+
+
+ + + +
+
+
+
+
+ 示例二 +
+
+
+
+
+
+
+ +`; + +exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demos/description.tsx correctly 1`] = ` + +
+
+ test +
+
+
+
+ + + +
+
+
+
+
+ 默认描述区域不会进行折行 +
+
+
+
+ + 选择一个由流程编排提供的典型用户案例,可以从中学习到流程编排很多设计理念。 + + 查看详情 + + +
+
+
+
+
+
+
+ + + +
+
+
+
+
+ 你可以通过排版组件进行省略 +
+
+
+
+
+ 选择一个由流程编排提供的典型用户案例,可以从中学习到流程编排很多设计理念。 +
+
+
+
+
+
+
+`; + +exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demos/description.tsx correctly 2`] = ` + +
+
+ test +
+
+
+
+ + + +
+
+
+
+
+ 默认描述区域不会进行折行 +
+
+
+
+ + 选择一个由流程编排提供的典型用户案例,可以从中学习到流程编排很多设计理念。 + + 查看详情 + + +
+
+
+
+
+
+
+ + + +
+
+
+
+
+ 你可以通过排版组件进行省略 +
+
+
+
+
+ 选择一个由流程编排提供的典型用户案例,可以从中学习到流程编排很多设计理念。 +
+
+
+
+
+
+
+`; + +exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demos/disabled.tsx correctly 1`] = ` + +
+
+ test +
+
+

+ 部分不可用 +

+
+
+
+ + + +
+
+
+
+
+ Card title +
+
+
+
+ This is the description +
+
+
+
+
+
+
+ + + +
+
+
+
+
+ Card title +
+
+
+
+ This is the description +
+
+
+
+
+
+
+ + + +
+
+
+
+
+ Card title +
+
+
+
+ This is the description +
+
+
+
+
+
+

+ 整体不可用 +

+
+
+
+
+
+
+
+ Card A +
+
+
+
+ 选项一 +
+
+
+
+
+
+
+
+
+
+ Card B +
+
+
+
+ 选项二 +
+
+
+
+
+
+
+
+`; + +exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demos/disabled.tsx correctly 2`] = ` + +
+
+ test +
+
+

+ 部分不可用 +

+
+
+
+ + + +
+
+
+
+
+ Card title +
+
+
+
+ This is the description +
+
+
+
+
+
+
+ + + +
+
+
+
+
+ Card title +
+
+
+
+ This is the description +
+
+
+
+
+
+
+ + + +
+
+
+
+
+ Card title +
+
+
+
+ This is the description +
+
+
+
+
+
+

+ 整体不可用 +

+
+
+
+
+
+
+
+ Card A +
+
+
+
+ 选项一 +
+
+
+
+
+
+
+
+
+
+ Card B +
+
+
+
+ 选项二 +
+
+
+
+
+
+
+
+`; + +exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demos/extra.tsx correctly 1`] = ` + +
+
+ test +
+
+
+
+ + + +
+
+
+
+
+ 示例一 +
+
+
+ + + +
+
+
+ 选择一个由流程编排提供的典型用户案例,可以从中学习到流程编排很多设计理念。 +
+
+
+
+
+
+`; + +exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demos/extra.tsx correctly 2`] = ` + +
+
+ test +
+
+
+
+ + + +
+
+
+
+
+ 示例一 +
+
+
+ + + +
+
+
+ 选择一个由流程编排提供的典型用户案例,可以从中学习到流程编排很多设计理念。 +
+
+
+
+
+
+`; + +exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demos/form.tsx correctly 1`] = ` + +
+
+ test +
+
+ +
+
+
+ +
+
+
+
+
+
+
+
+ + + +
+
+
+
+
+ Spring Boot +
+
+
+
+ 通过业界流行的技术栈来快速构建 Java 后端应用 +
+
+
+
+
+
+
+ + + +
+
+
+
+
+ SOFA Boot +
+
+
+
+ 使用 SOFAStack 中间件来快速构建分布式后端应用 +
+
+
+
+
+
+
+ + + +
+
+
+
+
+ Node JS +
+
+
+
+ 使用前后端统一的语言方案快速构建后端应用 +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+`; + +exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demos/form.tsx correctly 2`] = ` + +
+
+ test +
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+ + + +
+
+
+
+
+ Spring Boot +
+
+
+
+ 通过业界流行的技术栈来快速构建 Java 后端应用 +
+
+
+
+
+
+
+ + + +
+
+
+
+
+ SOFA Boot +
+
+
+
+ 使用 SOFAStack 中间件来快速构建分布式后端应用 +
+
+
+
+
+
+
+ + + +
+
+
+
+
+ Node JS +
+
+
+
+ 使用前后端统一的语言方案快速构建后端应用 +
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+`; + +exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demos/grid.tsx correctly 1`] = ` + +
+
+ test +
+
+
+
+
+
+
+
+
+
+ Card A +
+
+
+
+ This is the description +
+
+
+
+
+
+
+
+
+
+
+
+ Card B +
+
+
+
+ This is the description +
+
+
+
+
+
+
+
+
+
+
+
+ Card C +
+
+
+
+ This is the description +
+
+
+
+
+
+
+
+
+`; + +exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demos/grid.tsx correctly 2`] = ` + +
+
+ test +
+
+
+
+
+
+
+
+
+
+ Card A +
+
+
+
+ This is the description +
+
+
+
+
+
+
+
+
+
+
+
+ Card B +
+
+
+
+ This is the description +
+
+
+
+
+
+
+
+
+
+
+
+ Card C +
+
+
+
+ This is the description +
+
+
+
+
+
+
+
+
+`; + +exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demos/group.tsx correctly 1`] = ` + +
+
+ test +
+
+
+
+
- +
+
+ 🍎 Apple +
+
+
+
+
+
+
+
+
+
+
+
+ 🍐 Pear +
+
+
+
+
+
+
+
+
+
+
+
+ 🍊 Orange +
+
+
+
+
+
+
+
+
+
+
+
+
+
    +
  • +
  • +
  • +
  • +
+
+
+
+
+
+
+
+
+
    +
  • +
  • +
  • +
  • +
+
+
+
+
+
+
+
+
+
    +
  • +
  • +
  • +
  • +
+
+
+
+
+
+
+
@@ -1480,6 +3325,18 @@ exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demo
+
+ + + +
@@ -1492,96 +3349,140 @@ exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demo
- 🍎 Apple + OCR自定义
+
+ 这是一段关于该算法的说明 +
- -
-
+ + + +
+
-
    -
  • -
  • -
  • -
  • -
+
+ 关键点检测 +
+
+
+
+ 这是一段关于该算法的说明
@@ -1592,44 +3493,7 @@ exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demo
`; -exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demos/image.tsx correctly 1`] = ` - -
-
- test -
-
-
- example -
-
-
-
- checkcard -
-
-
-
-`; - -exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demos/list.tsx correctly 1`] = ` +exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demos/list.tsx correctly 2`] = `
📸 renders ./packages/card/src/components/CheckCard/demo class="ant-pro-checkcard-header-left" >
图像分类
@@ -1713,7 +3577,7 @@ exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demo class="ant-pro-checkcard-header-left" >
物体检测
@@ -1755,7 +3619,7 @@ exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demo class="ant-pro-checkcard-header-left" >
OCR自定义
@@ -1797,7 +3661,7 @@ exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demo class="ant-pro-checkcard-header-left" >
OCR
@@ -1839,7 +3703,7 @@ exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demo class="ant-pro-checkcard-header-left" >
视频分类
@@ -1881,7 +3745,7 @@ exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demo class="ant-pro-checkcard-header-left" >
关键点检测
@@ -1939,7 +3803,159 @@ exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demo `; -exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demos/multiple.tsx correctly 1`] = ` +exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demos/multiple.tsx correctly 1`] = ` + +
+
+ test +
+
+
+
+
+
+
+
+ Card A +
+
+
+
+ 选择一个由流程编排提供的典型用户案例,可以从中学习到流程编排很多设计理念 +
+
+
+
+
+
+
+
+
+
+ Card B +
+
+
+
+ 选择一个由流程编排提供的典型用户案例,可以从中学习到流程编排很多设计理念 +
+
+
+
+
+
+
+`; + +exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demos/multiple.tsx correctly 2`] = ` + +
+
+ test +
+
+
+
+
+
+
+
+ Card A +
+
+
+
+ 选择一个由流程编排提供的典型用户案例,可以从中学习到流程编排很多设计理念 +
+
+
+
+
+
+
+
+
+
+ Card B +
+
+
+
+ 选择一个由流程编排提供的典型用户案例,可以从中学习到流程编排很多设计理念 +
+
+
+
+
+
+
+`; + +exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demos/single.tsx correctly 1`] = `
📸 renders ./packages/card/src/components/CheckCard/demo class="ant-pro-checkcard-group" >
📸 renders ./packages/card/src/components/CheckCard/demo
- 选择一个由流程编排提供的典型用户案例,可以从中学习到流程编排很多设计理念 + 选项一
📸 renders ./packages/card/src/components/CheckCard/demo
- 选择一个由流程编排提供的典型用户案例,可以从中学习到流程编排很多设计理念 + 选项二 +
+
+
+
+
+
+
+
+
+
+ Card C +
+
+
+
+ 选项三,这是一个不可选项
@@ -2015,7 +4061,7 @@ exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demo `; -exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demos/single.tsx correctly 1`] = ` +exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demos/single.tsx correctly 2`] = `
📸 renders ./packages/card/src/components/CheckCard/demo class="ant-pro-checkcard-header-left" >
Card A
@@ -2072,7 +4118,7 @@ exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demo class="ant-pro-checkcard-header-left" >
Card B
@@ -2102,7 +4148,7 @@ exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demo class="ant-pro-checkcard-header-left" >
Card C
@@ -2229,6 +4275,114 @@ exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demo `; +exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demos/size.tsx correctly 2`] = ` + +
+
+ test +
+
+
+ + + +
+
+
+
+
+
+
+
+ Card title +
+
+
+
+ This is the description +
+
+
+
+
+
+`; + exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demos/title.tsx correctly 1`] = `
📸 renders ./packages/card/src/components/CheckCard/demo `; +exports[`card demos > 📸 renders ./packages/card/src/components/CheckCard/demos/title.tsx correctly 2`] = ` + +
+
+ test +
+
+
+
+
+
+
+
+ + + + + 示例 + + + blue + +
+
+
+
+
+ 选择一个由流程编排提供的典型用户案例,可以从中学习到流程编排很多设计理念 +
+
+
+
+
+
+
+
+
+
+ 标题内容过长会自动进行省略,标题内容过长会自动进行省略 +
+
+
+
+ 选择一个由流程编排提供的典型用户案例,可以从中学习到流程编排很多设计理念 +
+
+
+
+
+
+`; + exports[`card demos > 📸 renders ./packages/card/src/components/StatisticCard/demos/basic.tsx correctly 1`] = `
{ dropdownGroups, ); - // 关闭下拉菜单 - act(() => { - userEvent.click(document.body); - }); - - // 确保下拉菜单被正确关闭 - await waitForElementToBeRemoved(() => wrapper.queryByRole('listbox'), { - timeout: 100, // 设置超时时间 - }); - expect(wrapper.queryByRole('listbox')).toBeNull(); - wrapper.unmount(); }); diff --git a/tests/table/__snapshots__/demo.test.ts.snap b/tests/table/__snapshots__/demo.test.ts.snap index 809cb0357e5a..7e6df4347051 100644 --- a/tests/table/__snapshots__/demo.test.ts.snap +++ b/tests/table/__snapshots__/demo.test.ts.snap @@ -37296,6 +37296,696 @@ exports[`table demos > 📸 renders ./packages/table/src/demos/rtl_table.tsx cor `; +exports[`table demos > 📸 renders ./packages/table/src/demos/rtl_table.tsx correctly 2`] = ` + +
+
+ test +
+
+ +
+
+
+
+
+
+ نموذج احترافي +
+
+
+
+ +
+
+
+ + + + + +
+
+ + + + + +
+
+ + + +
+
+
+
+
+
+
+
+
+ + + + + + +
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + +
+ +
+
+ العنوان +
+ + + + + +
+
+
+ + الحالة + + + + + + +
+
+ التسمية + + التشغيل +
+
+
+ + + + + + + + + +
+
+ لا توجد بيانات +
+
+
+
+
+
+
+
+
+
+
+
+
+
+`; + exports[`table demos > 📸 renders ./packages/table/src/demos/search.tsx correctly 1`] = `