From a3c1e49eee0ab865b6caf02fc4137c2722b022fb Mon Sep 17 00:00:00 2001 From: neverland Date: Sat, 12 May 2018 16:08:09 +0800 Subject: [PATCH] [Improvement] Optimize demo test (#1053) --- .../test/__snapshots__/demo.spec.js.snap | 53 ++++++++++ .../test/__snapshots__/index.spec.js.snap | 52 --------- .../test/demo.spec.js} | 4 +- packages/actionsheet/test/index.spec.js | 3 - .../{index.spec.js.snap => demo.spec.js.snap} | 2 +- .../test/demo.spec.js} | 4 +- packages/address-edit/test/index.spec.js | 4 - .../{index.spec.js.snap => demo.spec.js.snap} | 2 +- .../test/demo.spec.js} | 4 +- packages/address-list/test/index.spec.js | 4 - .../{index.spec.js.snap => demo.spec.js.snap} | 2 +- .../index.spec.js => area/test/demo.spec.js} | 4 +- .../{index.spec.js.snap => demo.spec.js.snap} | 2 +- packages/badge/test/demo.spec.js | 4 + packages/badge/test/index.spec.js | 3 - .../{index.spec.js.snap => demo.spec.js.snap} | 2 +- packages/button/test/demo.spec.js | 4 + .../{index.spec.js.snap => demo.spec.js.snap} | 2 +- packages/card/test/demo.spec.js | 4 + .../{index.spec.js.snap => demo.spec.js.snap} | 2 +- packages/cell-swipe/test/demo.spec.js | 4 + packages/cell-swipe/test/index.spec.js | 4 - .../{index.spec.js.snap => demo.spec.js.snap} | 2 +- packages/cell/test/demo.spec.js | 4 + .../{index.spec.js.snap => demo.spec.js.snap} | 2 +- packages/checkbox/test/demo.spec.js | 4 + packages/checkbox/test/index.spec.js | 4 - .../{index.spec.js.snap => demo.spec.js.snap} | 2 +- packages/circle/test/demo.spec.js | 4 + packages/circle/test/index.spec.js | 4 - .../{index.spec.js.snap => demo.spec.js.snap} | 2 +- packages/col/test/demo.spec.js | 4 + packages/col/test/index.spec.js | 4 - .../{index.spec.js.snap => demo.spec.js.snap} | 2 +- packages/collapse/test/demo.spec.js | 4 + packages/collapse/test/index.spec.js | 4 - .../{index.spec.js.snap => demo.spec.js.snap} | 6 +- packages/contact-card/test/demo.spec.js | 4 + packages/contact-card/test/index.spec.js | 4 - .../test/__snapshots__/demo.spec.js.snap | 100 ++++++++++++++++++ .../test/__snapshots__/index.spec.js.snap | 99 ----------------- packages/coupon-list/test/demo.spec.js | 4 + packages/coupon-list/test/index.spec.js | 3 - .../{index.spec.js.snap => demo.spec.js.snap} | 2 +- packages/datetime-picker/test/demo.spec.js | 4 + packages/datetime-picker/test/index.spec.js | 4 - .../{index.spec.js.snap => demo.spec.js.snap} | 2 +- packages/dialog/test/demo.spec.js | 4 + packages/dialog/test/index.spec.js | 3 - .../{index.spec.js.snap => demo.spec.js.snap} | 2 +- packages/field/test/demo.spec.js | 4 + packages/field/test/index.spec.js | 4 - .../{index.spec.js.snap => demo.spec.js.snap} | 2 +- packages/goods-action/test/demo.spec.js | 4 + packages/goods-action/test/index.spec.js | 4 - .../{index.spec.js.snap => demo.spec.js.snap} | 2 +- packages/icon/test/demo.spec.js | 4 + packages/icon/test/index.spec.js | 4 - .../{index.spec.js.snap => demo.spec.js.snap} | 2 +- packages/list/test/demo.spec.js | 4 + packages/list/test/index.spec.js | 4 - .../{index.spec.js.snap => demo.spec.js.snap} | 2 +- packages/loading/test/demo.spec.js | 4 + packages/loading/test/index.spec.js | 4 - .../{index.spec.js.snap => demo.spec.js.snap} | 2 +- packages/nav-bar/test/demo.spec.js | 4 + packages/nav-bar/test/index.spec.js | 4 - .../{index.spec.js.snap => demo.spec.js.snap} | 2 +- packages/notice-bar/test/demo.spec.js | 4 + packages/notice-bar/test/index.spec.js | 4 - .../{index.spec.js.snap => demo.spec.js.snap} | 2 +- packages/number-keyboard/test/demo.spec.js | 4 + packages/number-keyboard/test/index.spec.js | 4 - .../{index.spec.js.snap => demo.spec.js.snap} | 2 +- packages/pagination/test/demo.spec.js | 4 + packages/pagination/test/index.spec.js | 4 - .../{index.spec.js.snap => demo.spec.js.snap} | 2 +- packages/panel/test/demo.spec.js | 4 + packages/panel/test/index.spec.js | 4 - .../{index.spec.js.snap => demo.spec.js.snap} | 2 +- packages/password-input/test/demo.spec.js | 4 + packages/password-input/test/index.spec.js | 4 - .../{index.spec.js.snap => demo.spec.js.snap} | 2 +- packages/picker/test/demo.spec.js | 4 + packages/picker/test/index.spec.js | 4 - .../{index.spec.js.snap => demo.spec.js.snap} | 2 +- packages/popup/test/demo.spec.js | 4 + packages/popup/test/index.spec.js | 4 - .../{index.spec.js.snap => demo.spec.js.snap} | 2 +- packages/progress/test/demo.spec.js | 4 + packages/progress/test/index.spec.js | 4 - .../{index.spec.js.snap => demo.spec.js.snap} | 2 +- packages/pull-refresh/test/demo.spec.js | 4 + packages/pull-refresh/test/index.spec.js | 4 - .../{index.spec.js.snap => demo.spec.js.snap} | 2 +- packages/radio/test/demo.spec.js | 4 + packages/radio/test/index.spec.js | 4 - .../rate/test/__snapshots__/demo.spec.js.snap | 66 ++++++++++++ packages/rate/test/demo.spec.js | 4 + .../{index.spec.js.snap => demo.spec.js.snap} | 2 +- packages/search/test/demo.spec.js | 4 + packages/search/test/index.spec.js | 4 - .../{index.spec.js.snap => demo.spec.js.snap} | 2 +- packages/sku/test/demo.spec.js | 4 + packages/sku/test/index.spec.js | 4 - .../{index.spec.js.snap => demo.spec.js.snap} | 2 +- packages/slider/test/demo.spec.js | 4 + packages/slider/test/index.spec.js | 4 - .../{index.spec.js.snap => demo.spec.js.snap} | 2 +- packages/stepper/test/demo.spec.js | 4 + packages/stepper/test/index.spec.js | 4 - .../{index.spec.js.snap => demo.spec.js.snap} | 2 +- packages/steps/test/demo.spec.js | 4 + packages/steps/test/index.spec.js | 4 - .../test/__snapshots__/demo.spec.js.snap | 64 +++++++++++ .../test/__snapshots__/index.spec.js.snap | 63 ----------- packages/submit-bar/test/demo.spec.js | 4 + packages/submit-bar/test/index.spec.js | 3 - .../{index.spec.js.snap => demo.spec.js.snap} | 2 +- packages/swipe/test/demo.spec.js | 4 + packages/swipe/test/index.spec.js | 4 - .../{index.spec.js.snap => demo.spec.js.snap} | 2 +- packages/switch-cell/test/demo.spec.js | 4 + packages/switch-cell/test/index.spec.js | 4 - .../{index.spec.js.snap => demo.spec.js.snap} | 2 +- packages/switch/test/demo.spec.js | 4 + packages/switch/test/index.spec.js | 4 - .../test/__snapshots__/demo.spec.js.snap} | 2 +- packages/tab/test/demo.spec.js | 4 + .../{index.spec.js.snap => demo.spec.js.snap} | 2 +- packages/tabbar/test/demo.spec.js | 4 + packages/tabbar/test/index.spec.js | 4 - packages/tabs/test/index.spec.js | 3 - .../{index.spec.js.snap => demo.spec.js.snap} | 2 +- packages/tag/test/demo.spec.js | 4 + packages/tag/test/index.spec.js | 4 - .../{index.spec.js.snap => demo.spec.js.snap} | 2 +- packages/toast/test/demo.spec.js | 4 + packages/toast/test/index.spec.js | 3 - .../test/__snapshots__/demo.spec.js.snap | 57 ++++++++++ .../test/__snapshots__/index.spec.js.snap | 56 ---------- packages/tree-select/test/demo.spec.js | 4 + packages/tree-select/test/index.spec.js | 3 - .../{index.spec.js.snap => demo.spec.js.snap} | 2 +- packages/uploader/test/demo.spec.js | 4 + packages/uploader/test/index.spec.js | 4 - test/demo-test.js | 29 ++--- 147 files changed, 582 insertions(+), 513 deletions(-) create mode 100644 packages/actionsheet/test/__snapshots__/demo.spec.js.snap rename packages/{area/test/index.spec.js => actionsheet/test/demo.spec.js} (52%) rename packages/address-edit/test/__snapshots__/{index.spec.js.snap => demo.spec.js.snap} (99%) rename packages/{card/test/index.spec.js => address-edit/test/demo.spec.js} (52%) delete mode 100644 packages/address-edit/test/index.spec.js rename packages/address-list/test/__snapshots__/{index.spec.js.snap => demo.spec.js.snap} (98%) rename packages/{button/test/index.spec.js => address-list/test/demo.spec.js} (52%) delete mode 100644 packages/address-list/test/index.spec.js rename packages/area/test/__snapshots__/{index.spec.js.snap => demo.spec.js.snap} (99%) rename packages/{cell/test/index.spec.js => area/test/demo.spec.js} (52%) rename packages/badge/test/__snapshots__/{index.spec.js.snap => demo.spec.js.snap} (93%) create mode 100644 packages/badge/test/demo.spec.js rename packages/button/test/__snapshots__/{index.spec.js.snap => demo.spec.js.snap} (98%) create mode 100644 packages/button/test/demo.spec.js rename packages/card/test/__snapshots__/{index.spec.js.snap => demo.spec.js.snap} (97%) create mode 100644 packages/card/test/demo.spec.js rename packages/cell-swipe/test/__snapshots__/{index.spec.js.snap => demo.spec.js.snap} (97%) create mode 100644 packages/cell-swipe/test/demo.spec.js delete mode 100644 packages/cell-swipe/test/index.spec.js rename packages/cell/test/__snapshots__/{index.spec.js.snap => demo.spec.js.snap} (98%) create mode 100644 packages/cell/test/demo.spec.js rename packages/checkbox/test/__snapshots__/{index.spec.js.snap => demo.spec.js.snap} (99%) create mode 100644 packages/checkbox/test/demo.spec.js delete mode 100644 packages/checkbox/test/index.spec.js rename packages/circle/test/__snapshots__/{index.spec.js.snap => demo.spec.js.snap} (97%) create mode 100644 packages/circle/test/demo.spec.js delete mode 100644 packages/circle/test/index.spec.js rename packages/col/test/__snapshots__/{index.spec.js.snap => demo.spec.js.snap} (95%) create mode 100644 packages/col/test/demo.spec.js delete mode 100644 packages/col/test/index.spec.js rename packages/collapse/test/__snapshots__/{index.spec.js.snap => demo.spec.js.snap} (99%) create mode 100644 packages/collapse/test/demo.spec.js delete mode 100644 packages/collapse/test/index.spec.js rename packages/contact-card/test/__snapshots__/{index.spec.js.snap => demo.spec.js.snap} (94%) create mode 100644 packages/contact-card/test/demo.spec.js delete mode 100644 packages/contact-card/test/index.spec.js create mode 100644 packages/coupon-list/test/__snapshots__/demo.spec.js.snap create mode 100644 packages/coupon-list/test/demo.spec.js rename packages/datetime-picker/test/__snapshots__/{index.spec.js.snap => demo.spec.js.snap} (99%) create mode 100644 packages/datetime-picker/test/demo.spec.js delete mode 100644 packages/datetime-picker/test/index.spec.js rename packages/dialog/test/__snapshots__/{index.spec.js.snap => demo.spec.js.snap} (98%) create mode 100644 packages/dialog/test/demo.spec.js delete mode 100644 packages/dialog/test/index.spec.js rename packages/field/test/__snapshots__/{index.spec.js.snap => demo.spec.js.snap} (99%) create mode 100644 packages/field/test/demo.spec.js delete mode 100644 packages/field/test/index.spec.js rename packages/goods-action/test/__snapshots__/{index.spec.js.snap => demo.spec.js.snap} (97%) create mode 100644 packages/goods-action/test/demo.spec.js delete mode 100644 packages/goods-action/test/index.spec.js rename packages/icon/test/__snapshots__/{index.spec.js.snap => demo.spec.js.snap} (99%) create mode 100644 packages/icon/test/demo.spec.js delete mode 100644 packages/icon/test/index.spec.js rename packages/list/test/__snapshots__/{index.spec.js.snap => demo.spec.js.snap} (95%) create mode 100644 packages/list/test/demo.spec.js delete mode 100644 packages/list/test/index.spec.js rename packages/loading/test/__snapshots__/{index.spec.js.snap => demo.spec.js.snap} (96%) create mode 100644 packages/loading/test/demo.spec.js delete mode 100644 packages/loading/test/index.spec.js rename packages/nav-bar/test/__snapshots__/{index.spec.js.snap => demo.spec.js.snap} (96%) create mode 100644 packages/nav-bar/test/demo.spec.js delete mode 100644 packages/nav-bar/test/index.spec.js rename packages/notice-bar/test/__snapshots__/{index.spec.js.snap => demo.spec.js.snap} (97%) create mode 100644 packages/notice-bar/test/demo.spec.js delete mode 100644 packages/notice-bar/test/index.spec.js rename packages/number-keyboard/test/__snapshots__/{index.spec.js.snap => demo.spec.js.snap} (97%) create mode 100644 packages/number-keyboard/test/demo.spec.js delete mode 100644 packages/number-keyboard/test/index.spec.js rename packages/pagination/test/__snapshots__/{index.spec.js.snap => demo.spec.js.snap} (97%) create mode 100644 packages/pagination/test/demo.spec.js delete mode 100644 packages/pagination/test/index.spec.js rename packages/panel/test/__snapshots__/{index.spec.js.snap => demo.spec.js.snap} (97%) create mode 100644 packages/panel/test/demo.spec.js delete mode 100644 packages/panel/test/index.spec.js rename packages/password-input/test/__snapshots__/{index.spec.js.snap => demo.spec.js.snap} (97%) create mode 100644 packages/password-input/test/demo.spec.js delete mode 100644 packages/password-input/test/index.spec.js rename packages/picker/test/__snapshots__/{index.spec.js.snap => demo.spec.js.snap} (99%) create mode 100644 packages/picker/test/demo.spec.js delete mode 100644 packages/picker/test/index.spec.js rename packages/popup/test/__snapshots__/{index.spec.js.snap => demo.spec.js.snap} (98%) create mode 100644 packages/popup/test/demo.spec.js delete mode 100644 packages/popup/test/index.spec.js rename packages/progress/test/__snapshots__/{index.spec.js.snap => demo.spec.js.snap} (98%) create mode 100644 packages/progress/test/demo.spec.js delete mode 100644 packages/progress/test/index.spec.js rename packages/pull-refresh/test/__snapshots__/{index.spec.js.snap => demo.spec.js.snap} (88%) create mode 100644 packages/pull-refresh/test/demo.spec.js delete mode 100644 packages/pull-refresh/test/index.spec.js rename packages/radio/test/__snapshots__/{index.spec.js.snap => demo.spec.js.snap} (98%) create mode 100644 packages/radio/test/demo.spec.js delete mode 100644 packages/radio/test/index.spec.js create mode 100644 packages/rate/test/__snapshots__/demo.spec.js.snap create mode 100644 packages/rate/test/demo.spec.js rename packages/search/test/__snapshots__/{index.spec.js.snap => demo.spec.js.snap} (98%) create mode 100644 packages/search/test/demo.spec.js delete mode 100644 packages/search/test/index.spec.js rename packages/sku/test/__snapshots__/{index.spec.js.snap => demo.spec.js.snap} (50%) create mode 100644 packages/sku/test/demo.spec.js delete mode 100644 packages/sku/test/index.spec.js rename packages/slider/test/__snapshots__/{index.spec.js.snap => demo.spec.js.snap} (94%) create mode 100644 packages/slider/test/demo.spec.js delete mode 100644 packages/slider/test/index.spec.js rename packages/stepper/test/__snapshots__/{index.spec.js.snap => demo.spec.js.snap} (95%) create mode 100644 packages/stepper/test/demo.spec.js delete mode 100644 packages/stepper/test/index.spec.js rename packages/steps/test/__snapshots__/{index.spec.js.snap => demo.spec.js.snap} (99%) create mode 100644 packages/steps/test/demo.spec.js delete mode 100644 packages/steps/test/index.spec.js create mode 100644 packages/submit-bar/test/__snapshots__/demo.spec.js.snap create mode 100644 packages/submit-bar/test/demo.spec.js rename packages/swipe/test/__snapshots__/{index.spec.js.snap => demo.spec.js.snap} (98%) create mode 100644 packages/swipe/test/demo.spec.js delete mode 100644 packages/swipe/test/index.spec.js rename packages/switch-cell/test/__snapshots__/{index.spec.js.snap => demo.spec.js.snap} (97%) create mode 100644 packages/switch-cell/test/demo.spec.js delete mode 100644 packages/switch-cell/test/index.spec.js rename packages/switch/test/__snapshots__/{index.spec.js.snap => demo.spec.js.snap} (95%) create mode 100644 packages/switch/test/demo.spec.js delete mode 100644 packages/switch/test/index.spec.js rename packages/{tabs/test/__snapshots__/index.spec.js.snap => tab/test/__snapshots__/demo.spec.js.snap} (99%) create mode 100644 packages/tab/test/demo.spec.js rename packages/tabbar/test/__snapshots__/{index.spec.js.snap => demo.spec.js.snap} (98%) create mode 100644 packages/tabbar/test/demo.spec.js delete mode 100644 packages/tabbar/test/index.spec.js delete mode 100644 packages/tabs/test/index.spec.js rename packages/tag/test/__snapshots__/{index.spec.js.snap => demo.spec.js.snap} (96%) create mode 100644 packages/tag/test/demo.spec.js delete mode 100644 packages/tag/test/index.spec.js rename packages/toast/test/__snapshots__/{index.spec.js.snap => demo.spec.js.snap} (95%) create mode 100644 packages/toast/test/demo.spec.js delete mode 100644 packages/toast/test/index.spec.js create mode 100644 packages/tree-select/test/__snapshots__/demo.spec.js.snap create mode 100644 packages/tree-select/test/demo.spec.js rename packages/uploader/test/__snapshots__/{index.spec.js.snap => demo.spec.js.snap} (93%) create mode 100644 packages/uploader/test/demo.spec.js delete mode 100644 packages/uploader/test/index.spec.js diff --git a/packages/actionsheet/test/__snapshots__/demo.spec.js.snap b/packages/actionsheet/test/__snapshots__/demo.spec.js.snap new file mode 100644 index 000000000..43ceb00c5 --- /dev/null +++ b/packages/actionsheet/test/__snapshots__/demo.spec.js.snap @@ -0,0 +1,53 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`renders demo correctly 1`] = ` +
+
+ + +
+
+ + +
+
+ + +
+
+`; diff --git a/packages/actionsheet/test/__snapshots__/index.spec.js.snap b/packages/actionsheet/test/__snapshots__/index.spec.js.snap index a300537d2..cf80ae45d 100644 --- a/packages/actionsheet/test/__snapshots__/index.spec.js.snap +++ b/packages/actionsheet/test/__snapshots__/index.spec.js.snap @@ -13,55 +13,3 @@ exports[`callback events 1`] = `
Cancel
`; - -exports[`renders actionsheet correctly 1`] = ` -
-
- - -
-
- - -
-
- - -
-
-`; diff --git a/packages/area/test/index.spec.js b/packages/actionsheet/test/demo.spec.js similarity index 52% rename from packages/area/test/index.spec.js rename to packages/actionsheet/test/demo.spec.js index b2a1e9abc..d647cfabc 100644 --- a/packages/area/test/index.spec.js +++ b/packages/actionsheet/test/demo.spec.js @@ -1,4 +1,4 @@ -import Area from '../'; +import Demo from '../demo'; import demoTest from '../../../test/demo-test'; -demoTest(Area); +demoTest(Demo); diff --git a/packages/actionsheet/test/index.spec.js b/packages/actionsheet/test/index.spec.js index 3d645703f..01ff7afd4 100644 --- a/packages/actionsheet/test/index.spec.js +++ b/packages/actionsheet/test/index.spec.js @@ -1,8 +1,5 @@ import { shallow } from '@vue/test-utils'; import Actionsheet from '../'; -import demoTest from '../../../test/demo-test'; - -demoTest(Actionsheet); test('callback events', () => { const callback = jest.fn(); diff --git a/packages/address-edit/test/__snapshots__/index.spec.js.snap b/packages/address-edit/test/__snapshots__/demo.spec.js.snap similarity index 99% rename from packages/address-edit/test/__snapshots__/index.spec.js.snap rename to packages/address-edit/test/__snapshots__/demo.spec.js.snap index d6e6d21f5..239359074 100644 --- a/packages/address-edit/test/__snapshots__/index.spec.js.snap +++ b/packages/address-edit/test/__snapshots__/demo.spec.js.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`renders address-edit correctly 1`] = ` +exports[`renders demo correctly 1`] = `
diff --git a/packages/card/test/index.spec.js b/packages/address-edit/test/demo.spec.js similarity index 52% rename from packages/card/test/index.spec.js rename to packages/address-edit/test/demo.spec.js index 54674043f..d647cfabc 100644 --- a/packages/card/test/index.spec.js +++ b/packages/address-edit/test/demo.spec.js @@ -1,4 +1,4 @@ -import Card from '../'; +import Demo from '../demo'; import demoTest from '../../../test/demo-test'; -demoTest(Card); +demoTest(Demo); diff --git a/packages/address-edit/test/index.spec.js b/packages/address-edit/test/index.spec.js deleted file mode 100644 index 86fe2e5d5..000000000 --- a/packages/address-edit/test/index.spec.js +++ /dev/null @@ -1,4 +0,0 @@ -import AddressEdit from '../'; -import demoTest from '../../../test/demo-test'; - -demoTest(AddressEdit); diff --git a/packages/address-list/test/__snapshots__/index.spec.js.snap b/packages/address-list/test/__snapshots__/demo.spec.js.snap similarity index 98% rename from packages/address-list/test/__snapshots__/index.spec.js.snap rename to packages/address-list/test/__snapshots__/demo.spec.js.snap index e5ff3b5ec..4fdb1cd3a 100644 --- a/packages/address-list/test/__snapshots__/index.spec.js.snap +++ b/packages/address-list/test/__snapshots__/demo.spec.js.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`renders address-list correctly 1`] = ` +exports[`renders demo correctly 1`] = `
diff --git a/packages/button/test/index.spec.js b/packages/address-list/test/demo.spec.js similarity index 52% rename from packages/button/test/index.spec.js rename to packages/address-list/test/demo.spec.js index 2c360ff6e..d647cfabc 100644 --- a/packages/button/test/index.spec.js +++ b/packages/address-list/test/demo.spec.js @@ -1,4 +1,4 @@ -import Button from '../'; +import Demo from '../demo'; import demoTest from '../../../test/demo-test'; -demoTest(Button); +demoTest(Demo); diff --git a/packages/address-list/test/index.spec.js b/packages/address-list/test/index.spec.js deleted file mode 100644 index 7ad905cdb..000000000 --- a/packages/address-list/test/index.spec.js +++ /dev/null @@ -1,4 +0,0 @@ -import AddressList from '../'; -import demoTest from '../../../test/demo-test'; - -demoTest(AddressList); diff --git a/packages/area/test/__snapshots__/index.spec.js.snap b/packages/area/test/__snapshots__/demo.spec.js.snap similarity index 99% rename from packages/area/test/__snapshots__/index.spec.js.snap rename to packages/area/test/__snapshots__/demo.spec.js.snap index d9dd3e09d..c79d2a297 100644 --- a/packages/area/test/__snapshots__/index.spec.js.snap +++ b/packages/area/test/__snapshots__/demo.spec.js.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`renders area correctly 1`] = ` +exports[`renders demo correctly 1`] = `
diff --git a/packages/cell/test/index.spec.js b/packages/area/test/demo.spec.js similarity index 52% rename from packages/cell/test/index.spec.js rename to packages/area/test/demo.spec.js index 0a9003d0e..d647cfabc 100644 --- a/packages/cell/test/index.spec.js +++ b/packages/area/test/demo.spec.js @@ -1,4 +1,4 @@ -import Cell from '../'; +import Demo from '../demo'; import demoTest from '../../../test/demo-test'; -demoTest(Cell); +demoTest(Demo); diff --git a/packages/badge/test/__snapshots__/index.spec.js.snap b/packages/badge/test/__snapshots__/demo.spec.js.snap similarity index 93% rename from packages/badge/test/__snapshots__/index.spec.js.snap rename to packages/badge/test/__snapshots__/demo.spec.js.snap index fb843b21b..061ad756e 100644 --- a/packages/badge/test/__snapshots__/index.spec.js.snap +++ b/packages/badge/test/__snapshots__/demo.spec.js.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`renders badge correctly 1`] = ` +exports[`renders demo correctly 1`] = `
diff --git a/packages/badge/test/demo.spec.js b/packages/badge/test/demo.spec.js new file mode 100644 index 000000000..d647cfabc --- /dev/null +++ b/packages/badge/test/demo.spec.js @@ -0,0 +1,4 @@ +import Demo from '../demo'; +import demoTest from '../../../test/demo-test'; + +demoTest(Demo); diff --git a/packages/badge/test/index.spec.js b/packages/badge/test/index.spec.js index de93a1a94..9b3afe957 100644 --- a/packages/badge/test/index.spec.js +++ b/packages/badge/test/index.spec.js @@ -1,9 +1,6 @@ import { mount } from '@vue/test-utils'; import Badge from '../'; import BadgeGroup from '../../badge-group'; -import demoTest from '../../../test/demo-test'; - -demoTest(Badge); test('click', () => { const onClick = jest.fn(); diff --git a/packages/button/test/__snapshots__/index.spec.js.snap b/packages/button/test/__snapshots__/demo.spec.js.snap similarity index 98% rename from packages/button/test/__snapshots__/index.spec.js.snap rename to packages/button/test/__snapshots__/demo.spec.js.snap index 850f0f1bf..7cf19b217 100644 --- a/packages/button/test/__snapshots__/index.spec.js.snap +++ b/packages/button/test/__snapshots__/demo.spec.js.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`renders button correctly 1`] = ` +exports[`renders demo correctly 1`] = `
+
+
+
+
+
+
+

¥ 1.5

+

无使用门槛

+
+
+
+

优惠券名称

2017.03.10-2017.12.30 + + +
+
+
+
+
+
+

8.8折

+

满0.50元可用

+
+
+
+

优惠券名称

2017.03.10-2017.12.30 + + +
+
+

不可用优惠

+
+
+
+
+

¥ 1.5

+

无使用门槛

+
+
+
+

优惠券名称

2017.03.10-2017.12.30 +

优惠券不可用原因

+ +
+
+
+
+
+
+

1折

+

满0.50元可用

+
+
+
+

优惠券名称

2017.03.10-2017.12.30 +

优惠券不可用原因

+ +
+
+ +
+
不使用优惠
+
+
+
+
+`; diff --git a/packages/coupon-list/test/__snapshots__/index.spec.js.snap b/packages/coupon-list/test/__snapshots__/index.spec.js.snap index 449c5c8ba..3666c1b15 100644 --- a/packages/coupon-list/test/__snapshots__/index.spec.js.snap +++ b/packages/coupon-list/test/__snapshots__/index.spec.js.snap @@ -29,102 +29,3 @@ exports[`coupon cell 2`] = `
`; - -exports[`renders coupon-list correctly 1`] = ` -
-
-
-
- -
优惠券码 - -
-
您有 2 个可用优惠
- - - -
-
- -
-
-`; diff --git a/packages/coupon-list/test/demo.spec.js b/packages/coupon-list/test/demo.spec.js new file mode 100644 index 000000000..d647cfabc --- /dev/null +++ b/packages/coupon-list/test/demo.spec.js @@ -0,0 +1,4 @@ +import Demo from '../demo'; +import demoTest from '../../../test/demo-test'; + +demoTest(Demo); diff --git a/packages/coupon-list/test/index.spec.js b/packages/coupon-list/test/index.spec.js index 6d4073c82..f2d0ad9e9 100644 --- a/packages/coupon-list/test/index.spec.js +++ b/packages/coupon-list/test/index.spec.js @@ -1,10 +1,7 @@ -import demoTest from '../../../test/demo-test'; import CouponList from '../../coupon-list'; import CouponCell from '../../coupon-cell'; import { mount } from '@vue/test-utils'; -demoTest(CouponList); - test('exchange coupon', () => { const wrapper = mount(CouponList); const exchange = wrapper.find('.van-coupon-list__exchange'); diff --git a/packages/datetime-picker/test/__snapshots__/index.spec.js.snap b/packages/datetime-picker/test/__snapshots__/demo.spec.js.snap similarity index 99% rename from packages/datetime-picker/test/__snapshots__/index.spec.js.snap rename to packages/datetime-picker/test/__snapshots__/demo.spec.js.snap index 7f4179848..9ace71158 100644 --- a/packages/datetime-picker/test/__snapshots__/index.spec.js.snap +++ b/packages/datetime-picker/test/__snapshots__/demo.spec.js.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`renders datetime-picker correctly 1`] = ` +exports[`renders demo correctly 1`] = `
diff --git a/packages/datetime-picker/test/demo.spec.js b/packages/datetime-picker/test/demo.spec.js new file mode 100644 index 000000000..d647cfabc --- /dev/null +++ b/packages/datetime-picker/test/demo.spec.js @@ -0,0 +1,4 @@ +import Demo from '../demo'; +import demoTest from '../../../test/demo-test'; + +demoTest(Demo); diff --git a/packages/datetime-picker/test/index.spec.js b/packages/datetime-picker/test/index.spec.js deleted file mode 100644 index 9f2da99b1..000000000 --- a/packages/datetime-picker/test/index.spec.js +++ /dev/null @@ -1,4 +0,0 @@ -import DatetimePicker from '../'; -import demoTest from '../../../test/demo-test'; - -demoTest(DatetimePicker); diff --git a/packages/dialog/test/__snapshots__/index.spec.js.snap b/packages/dialog/test/__snapshots__/demo.spec.js.snap similarity index 98% rename from packages/dialog/test/__snapshots__/index.spec.js.snap rename to packages/dialog/test/__snapshots__/demo.spec.js.snap index 231a690b8..2105b9c08 100644 --- a/packages/dialog/test/__snapshots__/index.spec.js.snap +++ b/packages/dialog/test/__snapshots__/demo.spec.js.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`renders dialog correctly 1`] = ` +exports[`renders demo correctly 1`] = `
+
+
+
+
+
+
+ 您的收货地址不支持同城送, 我们已为您推荐快递
+
+
合计: ¥30. 50
+ +
+
+
+
+
+ +
+
合计: ¥30. 50
+ +
+
+
+
+
+
+ + 您的收货地址不支持同城送, 修改地址 +
+
+
+ + + 全选
+
合计: ¥30. 50
+ +
+
+
+
+`; diff --git a/packages/submit-bar/test/__snapshots__/index.spec.js.snap b/packages/submit-bar/test/__snapshots__/index.spec.js.snap index 01c4e4e8d..a495dfe26 100644 --- a/packages/submit-bar/test/__snapshots__/index.spec.js.snap +++ b/packages/submit-bar/test/__snapshots__/index.spec.js.snap @@ -1,68 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`renders submit-bar correctly 1`] = ` -
-
-
- -
-
合计: ¥30. 50
- -
-
-
-
-
-
- 您的收货地址不支持同城送, 我们已为您推荐快递
-
-
合计: ¥30. 50
- -
-
-
-
-
- -
-
合计: ¥30. 50
- -
-
-
-
-
-
- - 您的收货地址不支持同城送, 修改地址 -
-
-
- - - 全选
-
合计: ¥30. 50
- -
-
-
-
-`; - exports[`submit 1`] = `