From 88642f6048c2347ece2830df6da1afd69d6911cf Mon Sep 17 00:00:00 2001 From: tae Date: Sun, 2 Feb 2020 12:12:07 +0900 Subject: [PATCH] refactor: Progress use `React.Fragment` to remove unused div (#21170) --- .../__snapshots__/components.test.js.snap | 84 ++- components/progress/Line.tsx | 8 +- .../__tests__/__snapshots__/demo.test.js.snap | 532 +++++++++--------- .../__snapshots__/index.test.js.snap | 364 ++++++------ .../__snapshots__/uploadlist.test.js.snap | 32 +- 5 files changed, 483 insertions(+), 537 deletions(-) diff --git a/components/config-provider/__tests__/__snapshots__/components.test.js.snap b/components/config-provider/__tests__/__snapshots__/components.test.js.snap index b173694b66..0da6f6fa69 100644 --- a/components/config-provider/__tests__/__snapshots__/components.test.js.snap +++ b/components/config-provider/__tests__/__snapshots__/components.test.js.snap @@ -9226,26 +9226,24 @@ exports[`ConfigProvider components Progress configProvider 1`] = `
-
+
-
-
+ class="config-progress-bg" + style="width:0%;height:8px;border-radius:" + />
- - 0% -
+ + 0% +
`; @@ -9253,26 +9251,24 @@ exports[`ConfigProvider components Progress normal 1`] = `
-
+
-
-
+ class="ant-progress-bg" + style="width:0%;height:8px;border-radius:" + />
- - 0% -
+ + 0% +
`; @@ -9280,26 +9276,24 @@ exports[`ConfigProvider components Progress prefixCls 1`] = `
-
+
-
-
+ class="prefix-Progress-bg" + style="width:0%;height:8px;border-radius:" + />
- - 0% -
+ + 0% +
`; diff --git a/components/progress/Line.tsx b/components/progress/Line.tsx index 8a85ef7d25..8f38c1db24 100644 --- a/components/progress/Line.tsx +++ b/components/progress/Line.tsx @@ -1,6 +1,8 @@ import * as React from 'react'; + +import { ProgressGradient, ProgressProps, StringGradients } from './progress'; + import { validProgress } from './utils'; -import { ProgressProps, ProgressGradient, StringGradients } from './progress'; interface LineProps extends ProgressProps { prefixCls: string; @@ -92,7 +94,7 @@ const Line: React.SFC = props => {
) : null; return ( -
+ <>
@@ -100,7 +102,7 @@ const Line: React.SFC = props => {
{children} -
+ ); }; diff --git a/components/progress/__tests__/__snapshots__/demo.test.js.snap b/components/progress/__tests__/__snapshots__/demo.test.js.snap index 745a058cb9..8749dfef6b 100644 --- a/components/progress/__tests__/__snapshots__/demo.test.js.snap +++ b/components/progress/__tests__/__snapshots__/demo.test.js.snap @@ -481,26 +481,24 @@ exports[`renders ./components/progress/demo/dynamic.md correctly 1`] = `
-
+
-
-
+ class="ant-progress-bg" + style="width:0%;height:8px;border-radius:" + />
- - 0% -
+ + 0% +
-
+
-
-
+ class="ant-progress-bg" + style="width:99.9%;height:8px;border-radius:;background-image:linear-gradient(to right, #108ee9 0%, #87d068 100%)" + />
- - 99.9% -
+ + 99.9% +
-
+
-
-
+ class="ant-progress-bg" + style="width:99.9%;height:8px;border-radius:;background-image:linear-gradient(to right, #108ee9, #87d068)" + />
- - 99.9% -
+ + 99.9% +
-
+
-
-
+ class="ant-progress-bg" + style="width:30%;height:8px;border-radius:" + />
- - 30% -
+ + 30% +
-
+
-
-
+ class="ant-progress-bg" + style="width:50%;height:8px;border-radius:" + />
- - 50% -
+ + 50% +
-
+
-
-
+ class="ant-progress-bg" + style="width:70%;height:8px;border-radius:" + />
- - - - -
+ + + + +
-
+
-
-
+ class="ant-progress-bg" + style="width:100%;height:8px;border-radius:" + />
- - - - -
+ + + + +
-
+
-
-
+ class="ant-progress-bg" + style="width:50%;height:8px;border-radius:" + />
@@ -1001,134 +985,126 @@ exports[`renders ./components/progress/demo/line-mini.md correctly 1`] = `
-
+
-
-
+ class="ant-progress-bg" + style="width:30%;height:6px;border-radius:" + />
- - 30% -
+ + 30% +
-
+
-
-
+ class="ant-progress-bg" + style="width:50%;height:6px;border-radius:" + />
- - 50% -
+ + 50% +
-
+
-
-
+ class="ant-progress-bg" + style="width:70%;height:6px;border-radius:" + />
- - - - -
+ + + + +
-
+
-
-
+ class="ant-progress-bg" + style="width:100%;height:6px;border-radius:" + />
- - - - -
+ + + + +
`; @@ -1138,26 +1114,24 @@ exports[`renders ./components/progress/demo/linecap.md correctly 1`] = `
-
+
-
-
+ class="ant-progress-bg" + style="width:75%;height:8px;border-radius:0" + />
- - 75% -
+ + 75% +
-
+
-
-
-
+ class="ant-progress-bg" + style="width:60%;height:8px;border-radius:" + /> +
- - 60% -
+ + 60% +
-
+
-
-
-
+ class="ant-progress-bg" + style="width: 50%; height: 8px;" + /> +
- - 50 10 -
+ + 50 10 +
`; @@ -35,26 +33,24 @@ exports[`Progress render negetive progress 1`] = `
-
+
-
-
+ class="ant-progress-bg" + style="width: 0%; height: 8px;" + />
- - 0% -
+ + 0% +
`; @@ -62,30 +58,28 @@ exports[`Progress render negetive successPercent 1`] = `
-
+
-
-
-
+ class="ant-progress-bg" + style="width: 50%; height: 8px;" + /> +
- - 50% -
+ + 50% +
`; @@ -93,26 +87,24 @@ exports[`Progress render normal progress 1`] = `
-
+
-
-
+ class="ant-progress-bg" + style="width: 0%; height: 8px;" + />
- - 0% -
+ + 0% +
`; @@ -120,44 +112,42 @@ exports[`Progress render out-of-range progress 1`] = `
-
+
-
-
+ class="ant-progress-bg" + style="width: 100%; height: 8px;" + />
- - - - -
+ + + + +
`; @@ -165,44 +155,42 @@ exports[`Progress render out-of-range progress with info 1`] = `
-
+
-
-
+ class="ant-progress-bg" + style="width: 100%; height: 8px;" + />
- - - - -
+ + + + +
`; @@ -285,33 +273,31 @@ exports[`Progress render strokeColor 2`] = ` trailColor={null} type="line" > -
+
-
-
+ } + />
- - 50% -
+ + 50% +
@@ -352,33 +338,31 @@ exports[`Progress render strokeColor 3`] = ` trailColor={null} type="line" > -
+
-
-
+ } + />
- - 50% -
+ + 50% +
@@ -388,25 +372,23 @@ exports[`Progress rtl render component should be rendered correctly in RTL direc
-
+
-
-
+ class="ant-progress-bg" + style="width:0%;height:8px;border-radius:" + />
- - 0% -
+ + 0% +
`; diff --git a/components/upload/__tests__/__snapshots__/uploadlist.test.js.snap b/components/upload/__tests__/__snapshots__/uploadlist.test.js.snap index 4514200be8..e82a82926d 100644 --- a/components/upload/__tests__/__snapshots__/uploadlist.test.js.snap +++ b/components/upload/__tests__/__snapshots__/uploadlist.test.js.snap @@ -211,18 +211,16 @@ exports[`Upload List should be uploading when upload a file 1`] = `
-
+
-
-
+ class="ant-progress-bg" + style="width: 0%; height: 2px;" + />
@@ -366,18 +364,16 @@ exports[`Upload List should be uploading when upload a file 2`] = `
-
+
-
-
+ class="ant-progress-bg" + style="width: 0%; height: 2px;" + />