diff --git a/.jest.js b/.jest.js index b2988233f..a4ebb8c61 100644 --- a/.jest.js +++ b/.jest.js @@ -18,6 +18,7 @@ function getTestRegex(libDir) { module.exports = { verbose: true, setupFiles: ['./tests/setup.js'], + setupFilesAfterEnv: ['./tests/setupAfterEnv.ts'], moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx', 'json', 'vue', 'md', 'jpg'], modulePathIgnorePatterns: ['/_site/'], testPathIgnorePatterns: testPathIgnorePatterns, diff --git a/components/affix/__tests__/__snapshots__/demo.test.js.snap b/components/affix/__tests__/__snapshots__/demo.test.js.snap index 65a2e4b0d..608656187 100644 --- a/components/affix/__tests__/__snapshots__/demo.test.js.snap +++ b/components/affix/__tests__/__snapshots__/demo.test.js.snap @@ -2,12 +2,14 @@ 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,6 +29,7 @@ exports[`renders ./components/affix/demo/target.vue correctly 1`] = `
+
diff --git a/components/affix/demo/basic.vue b/components/affix/demo/basic.vue index a1baee459..cab12bdd3 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 ab9df6076..2bd905c44 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 8256c26b1..852d46f28 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
- -
@@ -26,7 +26,7 @@ exports[`renders ./components/badge/demo/change.vue correctly 1`] = ` `; @@ -48,13 +48,13 @@ exports[`renders ./components/badge/demo/colors.vue correctly 1`] = `
lime
-#f50 +#f50
-#2db7f5 +#2db7f5
-#87d068 +#87d068
-#108ee9 +#108ee9 `; exports[`renders ./components/badge/demo/dot.vue correctly 1`] = ` @@ -89,8 +89,8 @@ exports[`renders ./components/badge/demo/overflow.vue correctly 1`] = ` `; exports[`renders ./components/badge/demo/ribbon.vue correctly 1`] = ` -
-
+
+
Pushes open the window
@@ -106,8 +106,8 @@ exports[`renders ./components/badge/demo/ribbon.vue correctly 1`] = `
-
-
+
+
Pushes open the window
@@ -123,8 +123,8 @@ exports[`renders ./components/badge/demo/ribbon.vue correctly 1`] = `
-
-
+
+
Pushes open the window
@@ -140,8 +140,8 @@ exports[`renders ./components/badge/demo/ribbon.vue correctly 1`] = `
-
-
+
+
Pushes open the window
@@ -157,8 +157,8 @@ exports[`renders ./components/badge/demo/ribbon.vue correctly 1`] = `
-
-
+
+
Pushes open the window
@@ -174,8 +174,8 @@ exports[`renders ./components/badge/demo/ribbon.vue correctly 1`] = `
-
-
+
+
Pushes open the window
@@ -191,8 +191,8 @@ exports[`renders ./components/badge/demo/ribbon.vue correctly 1`] = `
-
-
+
+
Pushes open the window
@@ -208,8 +208,8 @@ exports[`renders ./components/badge/demo/ribbon.vue correctly 1`] = `
-
-
+
+
Pushes open the window
diff --git a/components/badge/demo/basic.vue b/components/badge/demo/basic.vue index 883813466..1dba25843 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 996b70d3f..55c10dae2 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 dc6d47d71..00bd146d4 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 48998a752..5aeae1cd9 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 4375e885d..0af7f08e0 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 533ccc24b..2da2de9ed 100644 --- a/components/breadcrumb/__tests__/__snapshots__/Breadcrumb.test.js.snap +++ b/components/breadcrumb/__tests__/__snapshots__/Breadcrumb.test.js.snap @@ -40,7 +40,7 @@ exports[`Breadcrumb should support Breadcrumb.Item default separator 1`] = ` `; exports[`Breadcrumb should support custom attribute 1`] = ` -
- diff --git a/components/breadcrumb/demo/withIcon.vue b/components/breadcrumb/demo/withIcon.vue index 02c28b8cd..636c7dbed 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 25dbe2644..dd0b59672 100644 --- a/components/button/__tests__/__snapshots__/demo.test.js.snap +++ b/components/button/__tests__/__snapshots__/demo.test.js.snap @@ -4,7 +4,7 @@ exports[`renders ./components/button/demo/basic.vue correctly 1`] = ` - - -
-

- -
@@ -120,10 +120,10 @@ exports[`renders ./components/button/demo/disabled.vue correctly 1`] = ` Link(disabled)
- -
@@ -141,9 +141,9 @@ exports[`renders ./components/button/demo/disabled.vue correctly 1`] = ` Danger Link(disabled)
-
`; @@ -151,7 +151,7 @@ exports[`renders ./components/button/demo/disabled.vue correctly 1`] = ` exports[`renders ./components/button/demo/ghost.vue correctly 1`] = `
- + - - - - - + + + + + - +

- - + - - + +
- - - + + + - + `; exports[`renders ./components/button/demo/loading.vue correctly 1`] = ` -
+
-
+
@@ -205,12 +205,12 @@ exports[`renders ./components/button/demo/loading.vue correctly 1`] = `
-
+
-
+
-
+
`; @@ -219,10 +219,10 @@ exports[`renders ./components/button/demo/multiple.vue correctly 1`] = ` - - `; @@ -234,13 +234,13 @@ 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 00b3398d8..316ca068b 100644 --- a/components/button/__tests__/__snapshots__/index.test.js.snap +++ b/components/button/__tests__/__snapshots__/index.test.js.snap @@ -1,53 +1,53 @@ // 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`] = ` - `; @@ -59,7 +59,7 @@ 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 0e9300484..cfe216642 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 23a750b0d..d142bdbd8 100644 --- a/components/button/demo/button-group.vue +++ b/components/button/demo/button-group.vue @@ -56,23 +56,17 @@ Debug usage
- -
+ +
+
+
-
-
- -
- -
-
-
- -
- -
- +
+
`; -exports[`renders ./components/button/demo/multiple.vue correctly 1`] = ` - - - `; -exports[`renders ./components/button/demo/size.vue correctly 1`] = ` -
-
-
- - +`; + +exports[`renders ./components/float-button/demo/type.vue correctly 1`] = ` + + - - - -
- - - - - -
`; diff --git a/components/float-button/__tests__/__snapshots__/index.test.js.snap b/components/float-button/__tests__/__snapshots__/index.test.js.snap index 00b3398d8..c0cf145cb 100644 --- a/components/float-button/__tests__/__snapshots__/index.test.js.snap +++ b/components/float-button/__tests__/__snapshots__/index.test.js.snap @@ -1,65 +1,45 @@ // 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 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/float-button/demo/back-top.vue b/components/float-button/demo/back-top.vue index 61846bd16..a75bb2f7e 100644 --- a/components/float-button/demo/back-top.vue +++ b/components/float-button/demo/back-top.vue @@ -6,7 +6,7 @@ title: zh-CN: 回到顶部 en-US: BackTop --- - + ## zh-CN 返回页面顶部的操作按钮。 @@ -29,13 +29,3 @@ title:
- - diff --git a/components/float-button/demo/basic.vue b/components/float-button/demo/basic.vue index eadc0b307..eaf39b798 100644 --- a/components/float-button/demo/basic.vue +++ b/components/float-button/demo/basic.vue @@ -21,16 +21,6 @@ The most basic usage. - diff --git a/components/float-button/demo/description.vue b/components/float-button/demo/description.vue index c8ab9936a..befa27c1f 100644 --- a/components/float-button/demo/description.vue +++ b/components/float-button/demo/description.vue @@ -56,14 +56,6 @@ Setting `description` prop to show FloatButton with description. - diff --git a/components/float-button/demo/group-menu.vue b/components/float-button/demo/group-menu.vue index 7ebc58c96..2daa16f1b 100644 --- a/components/float-button/demo/group-menu.vue +++ b/components/float-button/demo/group-menu.vue @@ -15,7 +15,7 @@ title: Open menu mode with `trigger`, which could be `hover` or `click`. - + - diff --git a/components/float-button/demo/group.vue b/components/float-button/demo/group.vue index 103dbd9e2..14d0f7731 100644 --- a/components/float-button/demo/group.vue +++ b/components/float-button/demo/group.vue @@ -44,14 +44,6 @@ When multiple buttons are used together, `` is recommended. - diff --git a/components/float-button/demo/shape.vue b/components/float-button/demo/shape.vue index 5797ad97f..f71b1fd57 100644 --- a/components/float-button/demo/shape.vue +++ b/components/float-button/demo/shape.vue @@ -45,18 +45,7 @@ The most basic usage. - diff --git a/components/float-button/demo/tooltip.vue b/components/float-button/demo/tooltip.vue index ae05d4648..d1bfa1152 100644 --- a/components/float-button/demo/tooltip.vue +++ b/components/float-button/demo/tooltip.vue @@ -35,13 +35,3 @@ Setting `tooltip` prop to show FloatButton with tooltip. - - diff --git a/components/float-button/demo/type.vue b/components/float-button/demo/type.vue index 8523180f3..007923763 100644 --- a/components/float-button/demo/type.vue +++ b/components/float-button/demo/type.vue @@ -41,14 +41,6 @@ Change the type of the FloatButton with `type`. - diff --git a/components/form/__tests__/__snapshots__/demo.test.js.snap b/components/form/__tests__/__snapshots__/demo.test.js.snap index 33ced6434..7972ca268 100644 --- a/components/form/__tests__/__snapshots__/demo.test.js.snap +++ b/components/form/__tests__/__snapshots__/demo.test.js.snap @@ -5,160 +5,180 @@ exports[`renders ./components/form/demo/advanced-search.vue correctly 1`] = `
-
-