From 301dd70e6074b8d86b6d8bf58fa8b6781605514f Mon Sep 17 00:00:00 2001 From: CCherry07 <2405693142@qq.com> Date: Sun, 23 Apr 2023 20:32:55 +0800 Subject: [PATCH 01/12] feat(demo): A-B --- .../__tests__/__snapshots__/demo.test.js.snap | 12 +- components/affix/demo/basic.vue | 16 +- components/affix/demo/on-change.vue | 17 +- components/affix/demo/target.vue | 17 +- .../__tests__/__snapshots__/demo.test.js.snap | 182 +++++++++++++---- components/alert/demo/closable.vue | 16 +- components/alert/demo/custom-icon.vue | 8 +- components/alert/demo/index.vue | 2 +- components/alert/demo/smooth-closed.vue | 20 +- .../__tests__/__snapshots__/demo.test.js.snap | 42 ++-- components/anchor/demo/basic.vue | 16 +- components/anchor/demo/customizeHighlight.vue | 17 +- components/anchor/demo/onChange.vue | 17 +- components/anchor/demo/onClick.vue | 19 +- components/anchor/demo/targetOffset.vue | 18 +- .../__tests__/__snapshots__/demo.test.js.snap | 24 +-- components/auto-complete/demo/basic.vue | 40 ++-- .../auto-complete/demo/certain-category.vue | 18 +- components/auto-complete/demo/custom.vue | 41 ++-- .../auto-complete/demo/non-case-sensitive.vue | 29 ++- components/auto-complete/demo/options.vue | 37 ++-- components/auto-complete/demo/status.vue | 49 ++--- .../auto-complete/demo/uncertain-category.vue | 58 +++--- .../__snapshots__/Avatar.test.js.snap | 16 +- .../__tests__/__snapshots__/demo.test.js.snap | 54 ++--- components/avatar/demo/badge.vue | 10 +- components/avatar/demo/basic.vue | 8 +- components/avatar/demo/dynamic.vue | 27 +-- components/avatar/demo/group.vue | 8 +- components/avatar/demo/responsive.vue | 8 +- components/avatar/demo/type.vue | 8 +- .../__tests__/__snapshots__/demo.test.js.snap | 146 +++++++------- .../__snapshots__/index.test.js.snap | 22 +-- components/badge/demo/basic.vue | 8 +- components/badge/demo/change.vue | 37 ++-- components/badge/demo/colors.vue | 11 +- components/badge/demo/dot.vue | 8 +- .../breadcrumb/__tests__/Breadcrumb.test.js | 2 +- .../__snapshots__/Breadcrumb.test.js.snap | 10 +- .../__tests__/__snapshots__/demo.test.js.snap | 63 +++++- components/breadcrumb/demo/router.vue | 55 +++--- components/breadcrumb/demo/withIcon.vue | 9 +- .../__tests__/__snapshots__/demo.test.js.snap | 186 +++++++++--------- .../__snapshots__/index.test.js.snap | 24 +-- components/button/__tests__/wave.test.js | 51 ----- components/button/demo/button-group.vue | 14 +- components/button/demo/icon.vue | 7 +- components/button/demo/index.vue | 2 +- components/button/demo/loading.vue | 29 +-- components/button/demo/multiple.vue | 20 +- components/button/demo/size.vue | 15 +- 51 files changed, 696 insertions(+), 877 deletions(-) diff --git a/components/affix/__tests__/__snapshots__/demo.test.js.snap b/components/affix/__tests__/__snapshots__/demo.test.js.snap index 65a2e4b0d2..82e05c0a33 100644 --- a/components/affix/__tests__/__snapshots__/demo.test.js.snap +++ b/components/affix/__tests__/__snapshots__/demo.test.js.snap @@ -2,13 +2,15 @@ exports[`renders ./components/affix/demo/basic.vue correctly 1`] = `
-

-
@@ -16,7 +18,8 @@ exports[`renders ./components/affix/demo/basic.vue correctly 1`] = ` exports[`renders ./components/affix/demo/on-change.vue correctly 1`] = `
-
@@ -26,7 +29,8 @@ exports[`renders ./components/affix/demo/target.vue correctly 1`] = `
-
diff --git a/components/affix/demo/basic.vue b/components/affix/demo/basic.vue index a1baee459d..cab12bdd33 100644 --- a/components/affix/demo/basic.vue +++ b/components/affix/demo/basic.vue @@ -26,16 +26,8 @@ The simplest usage. - diff --git a/components/affix/demo/on-change.vue b/components/affix/demo/on-change.vue index ab9df60764..2bd905c446 100644 --- a/components/affix/demo/on-change.vue +++ b/components/affix/demo/on-change.vue @@ -21,17 +21,8 @@ Callback with affixed state. 120px to affix top - diff --git a/components/affix/demo/target.vue b/components/affix/demo/target.vue index 8256c26b1c..852d46f28e 100644 --- a/components/affix/demo/target.vue +++ b/components/affix/demo/target.vue @@ -25,23 +25,16 @@ Set a `target` for 'Affix', which is listen to scroll event of target element (d
- - - `; exports[`renders ./components/badge/demo/colors.vue correctly 1`] = `

Presets:

-
pink
-
red
-
yellow
-
orange
-
cyan
-
green
-
blue
-
purple
-
geekblue
-
magenta
-
volcano
-
gold
-
lime
+
pink
+
red
+
yellow
+
orange
+
cyan
+
green
+
blue
+
purple
+
geekblue
+
magenta
+
volcano
+
gold
+
lime
- -#f50 + +#f50
-#2db7f5 +#2db7f5
-#87d068 +#87d068
-#108ee9 +#108ee9 `; exports[`renders ./components/badge/demo/dot.vue correctly 1`] = ` - + -Link something +Link something `; exports[`renders ./components/badge/demo/link.vue correctly 1`] = ` -

5

+

5

`; exports[`renders ./components/badge/demo/no-wrapper.vue correctly 1`] = ` -

2

5

+

2

5

-

4

+

4

-99+ +99+ `; exports[`renders ./components/badge/demo/overflow.vue correctly 1`] = ` -

9

9

+

9

9

-99+ +99+ -10+ +10+ -999+ +999+ `; exports[`renders ./components/badge/demo/ribbon.vue correctly 1`] = ` -
-
+
+
Pushes open the window
@@ -102,12 +102,12 @@ exports[`renders ./components/badge/demo/ribbon.vue correctly 1`] = `
and raises the spyglass.
-
Hippies +
Hippies
-
-
+
+
Pushes open the window
@@ -119,12 +119,12 @@ exports[`renders ./components/badge/demo/ribbon.vue correctly 1`] = `
and raises the spyglass.
-
Hippies +
Hippies
-
-
+
+
Pushes open the window
@@ -136,12 +136,12 @@ exports[`renders ./components/badge/demo/ribbon.vue correctly 1`] = `
and raises the spyglass.
-
Hippies +
Hippies
-
-
+
+
Pushes open the window
@@ -153,12 +153,12 @@ exports[`renders ./components/badge/demo/ribbon.vue correctly 1`] = `
and raises the spyglass.
-
Hippies +
Hippies
-
-
+
+
Pushes open the window
@@ -170,12 +170,12 @@ exports[`renders ./components/badge/demo/ribbon.vue correctly 1`] = `
and raises the spyglass.
-
Hippies +
Hippies
-
-
+
+
Pushes open the window
@@ -187,12 +187,12 @@ exports[`renders ./components/badge/demo/ribbon.vue correctly 1`] = `
and raises the spyglass.
-
Hippies +
Hippies
-
-
+
+
Pushes open the window
@@ -204,12 +204,12 @@ exports[`renders ./components/badge/demo/ribbon.vue correctly 1`] = `
and raises the spyglass.
-
Hippies +
Hippies
-
-
+
+
Pushes open the window
@@ -221,31 +221,31 @@ exports[`renders ./components/badge/demo/ribbon.vue correctly 1`] = `
and raises the spyglass.
-
Hippies +
Hippies
`; exports[`renders ./components/badge/demo/status.vue correctly 1`] = ` - - - - - + + + + +
-Success +Success
-Error +Error
-Default +Default
-Processing +Processing
-warning +warning `; exports[`renders ./components/badge/demo/title.vue correctly 1`] = ` -

5

+

5

`; diff --git a/components/badge/__tests__/__snapshots__/index.test.js.snap b/components/badge/__tests__/__snapshots__/index.test.js.snap index 5d9c546ac2..3819afc8b1 100644 --- a/components/badge/__tests__/__snapshots__/index.test.js.snap +++ b/components/badge/__tests__/__snapshots__/index.test.js.snap @@ -2,48 +2,48 @@ exports[`Badge badge should support float number 1`] = `"3.5"`; -exports[`Badge badge should support float number 2`] = `3.5`; +exports[`Badge badge should support float number 2`] = `3.5`; exports[`Badge render correct with negative number 1`] = ` -

-

1

0

-

-

1

0

+

-

1

0

+

-

1

0

`; exports[`Badge should be compatible with borderColor style 1`] = ` -

4

+

4

`; exports[`Badge should render when count is changed 1`] = ` -

1

0

1

2

3

4

5

6

7

8

9

0

+

1

0

1

2

3

4

5

6

7

8

9

0

`; exports[`Badge should render when count is changed 2`] = ` -

1

1

2

3

4

5

6

7

8

9

0

1

+

1

1

2

3

4

5

6

7

8

9

0

1

`; exports[`Badge should render when count is changed 3`] = ` -

1

1

2

3

4

5

6

7

8

9

0

1

+

1

1

2

3

4

5

6

7

8

9

0

1

`; exports[`Badge should render when count is changed 4`] = ` -

1

0

1

2

3

4

5

6

7

8

9

0

+

1

0

1

2

3

4

5

6

7

8

9

0

`; exports[`Badge should render when count is changed 5`] = ` -

9

+

9

`; exports[`Badge should support offset when count is a VueNode 1`] = ` -head +head `; -exports[`Badge text works with vnode 1`] = `hello`; +exports[`Badge text works with vnode 1`] = `hello`; diff --git a/components/badge/demo/basic.vue b/components/badge/demo/basic.vue index 883813466a..1dba258435 100644 --- a/components/badge/demo/basic.vue +++ b/components/badge/demo/basic.vue @@ -30,12 +30,6 @@ Simplest Usage. Badge will be hidden when `count` is `0`, but we can use `showZe - diff --git a/components/badge/demo/change.vue b/components/badge/demo/change.vue index 996b70d3fe..55c10dae2b 100644 --- a/components/badge/demo/change.vue +++ b/components/badge/demo/change.vue @@ -35,31 +35,18 @@ The count will be animated as it changes. - diff --git a/components/badge/demo/colors.vue b/components/badge/demo/colors.vue index dc6d47d71d..00bd146d4c 100644 --- a/components/badge/demo/colors.vue +++ b/components/badge/demo/colors.vue @@ -32,9 +32,7 @@ New feature after 3.16.0. We preset a series of colorful Badge styles for use in
- diff --git a/components/badge/demo/dot.vue b/components/badge/demo/dot.vue index 48998a7529..5aeae1cd91 100644 --- a/components/badge/demo/dot.vue +++ b/components/badge/demo/dot.vue @@ -24,12 +24,6 @@ If count equals 0, it won't display the dot. Link something - diff --git a/components/breadcrumb/__tests__/Breadcrumb.test.js b/components/breadcrumb/__tests__/Breadcrumb.test.js index 4375e885d2..0af7f08e03 100644 --- a/components/breadcrumb/__tests__/Breadcrumb.test.js +++ b/components/breadcrumb/__tests__/Breadcrumb.test.js @@ -25,7 +25,7 @@ describe('Breadcrumb', () => { }); expect(errorSpy.mock.calls).toHaveLength(1); expect(errorSpy.mock.calls[0][0]).toMatch( - "Warning: [antdv: Breadcrumb] Only accepts Breadcrumb.Item and Breadcrumb.Separator as it's children", + "Warning: [ant-design-vue: Breadcrumb] Only accepts Breadcrumb.Item and Breadcrumb.Separator as it's children", ); }); diff --git a/components/breadcrumb/__tests__/__snapshots__/Breadcrumb.test.js.snap b/components/breadcrumb/__tests__/__snapshots__/Breadcrumb.test.js.snap index 533ccc24b1..a107dbd8c6 100644 --- a/components/breadcrumb/__tests__/__snapshots__/Breadcrumb.test.js.snap +++ b/components/breadcrumb/__tests__/__snapshots__/Breadcrumb.test.js.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Breadcrumb should allow Breadcrumb.Item is null or undefined 1`] = ` -
- diff --git a/components/breadcrumb/demo/withIcon.vue b/components/breadcrumb/demo/withIcon.vue index 02c28b8cdf..636c7dbeda 100644 --- a/components/breadcrumb/demo/withIcon.vue +++ b/components/breadcrumb/demo/withIcon.vue @@ -28,13 +28,6 @@ The icon should be placed in front of the text. Application - diff --git a/components/button/__tests__/__snapshots__/demo.test.js.snap b/components/button/__tests__/__snapshots__/demo.test.js.snap index 25dbe26448..df6ec9911c 100644 --- a/components/button/__tests__/__snapshots__/demo.test.js.snap +++ b/components/button/__tests__/__snapshots__/demo.test.js.snap @@ -1,37 +1,37 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`renders ./components/button/demo/basic.vue correctly 1`] = ` - - - - - `; exports[`renders ./components/button/demo/block.vue correctly 1`] = ` - - - - - `; @@ -39,218 +39,218 @@ exports[`renders ./components/button/demo/block.vue correctly 1`] = ` exports[`renders ./components/button/demo/button-group.vue correctly 1`] = `

Basic

-
-
-

With Icon

-
-
+
`; exports[`renders ./components/button/demo/danger.vue correctly 1`] = ` -
`; exports[`renders ./components/button/demo/disabled.vue correctly 1`] = ` - -
- -
- -
- -
- -
- -
- -
- -
-
`; exports[`renders ./components/button/demo/ghost.vue correctly 1`] = ` -
`; exports[`renders ./components/button/demo/icon.vue correctly 1`] = ` - - + - - - - - - - - + + + + + + + +

- - + - - - + + +
- - - - - + + + + + `; exports[`renders ./components/button/demo/loading.vue correctly 1`] = ` -
-
+
+
-
+
-
-
-
+
-
-
+
+
-
+
-
+
`; exports[`renders ./components/button/demo/multiple.vue correctly 1`] = ` - - - `; exports[`renders ./components/button/demo/size.vue correctly 1`] = ` -
+


- - - - -
- - - - - + + + + +
`; diff --git a/components/button/__tests__/__snapshots__/index.test.js.snap b/components/button/__tests__/__snapshots__/index.test.js.snap index 00b3398d8a..e7e1498f8e 100644 --- a/components/button/__tests__/__snapshots__/index.test.js.snap +++ b/components/button/__tests__/__snapshots__/index.test.js.snap @@ -1,65 +1,65 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Button fixbug renders {0} , 0 and {false} 1`] = ` - `; exports[`Button fixbug renders {0} , 0 and {false} 2`] = ` - `; exports[`Button fixbug renders {0} , 0 and {false} 3`] = ` - `; exports[`Button renders Chinese characters correctly 1`] = ` - `; exports[`Button renders Chinese characters correctly 2`] = ` - `; exports[`Button renders Chinese characters correctly 3`] = ` - `; -exports[`Button renders Chinese characters correctly 4`] = ``; +exports[`Button renders Chinese characters correctly 4`] = ``; -exports[`Button renders Chinese characters correctly 5`] = ``; +exports[`Button renders Chinese characters correctly 5`] = ``; exports[`Button renders Chinese characters correctly 6`] = ` - `; exports[`Button renders correctly 1`] = ` - `; exports[`Button should not render as link button when href is undefined 1`] = ` - `; exports[`Button should support link button 1`] = ` - + link button `; diff --git a/components/button/__tests__/wave.test.js b/components/button/__tests__/wave.test.js index 0e9300484c..cfe216642a 100644 --- a/components/button/__tests__/wave.test.js +++ b/components/button/__tests__/wave.test.js @@ -13,54 +13,6 @@ describe('click wave effect', () => { await sleep(20); } - it('should have click wave effect for primary button', async () => { - const wrapper = mount({ - render() { - return ; - }, - }); - await clickButton(wrapper); - expect(wrapper.find('.ant-btn').attributes('ant-click-animating-without-extra-node')).toBe( - 'true', - ); - }); - - it('should have click wave effect for default button', async () => { - const wrapper = mount({ - render() { - return ; - }, - }); - await clickButton(wrapper); - expect(wrapper.find('.ant-btn').attributes('ant-click-animating-without-extra-node')).toBe( - 'true', - ); - }); - - it('should not have click wave effect for link type button', async () => { - const wrapper = mount({ - render() { - return ; - }, - }); - await clickButton(wrapper); - expect(wrapper.find('.ant-btn').attributes('ant-click-animating-without-extra-node')).toBe( - undefined, - ); - }); - - it('should not have click wave effect for text type button', async () => { - const wrapper = mount({ - render() { - return ; - }, - }); - await clickButton(wrapper); - expect(wrapper.find('.ant-btn').attributes('ant-click-animating-without-extra-node')).toBe( - undefined, - ); - }); - it('should handle transitionstart', async () => { const wrapper = mount({ render() { @@ -70,9 +22,6 @@ describe('click wave effect', () => { await clickButton(wrapper); const buttonNode = wrapper.find('.ant-btn').element; buttonNode.dispatchEvent(new Event('transitionstart')); - expect(wrapper.find('.ant-btn').attributes('ant-click-animating-without-extra-node')).toBe( - 'true', - ); wrapper.unmount(); buttonNode.dispatchEvent(new Event('transitionstart')); }); diff --git a/components/button/demo/button-group.vue b/components/button/demo/button-group.vue index 23a750b0d7..d142bdbd81 100644 --- a/components/button/demo/button-group.vue +++ b/components/button/demo/button-group.vue @@ -56,23 +56,17 @@ Debug usage
- -New account`; +exports[`renders ./components/drawer/demo/form-in-drawer.vue correctly 1`] = ``; exports[`renders ./components/drawer/demo/multi-level-drawer.vue correctly 1`] = ` - `; exports[`renders ./components/drawer/demo/placement.vue correctly 1`] = ` -
- `; exports[`renders ./components/drawer/demo/render-in-current.vue correctly 1`] = ` -
Render in this
-
-
-
-
-
-
-
-
- -
Basic Drawer
-
+
+ +
`; exports[`renders ./components/drawer/demo/size.vue correctly 1`] = ` - - `; exports[`renders ./components/drawer/demo/user-profile.vue correctly 1`] = ` -
+
-
+