From b5e13563ebc1dc7bbba5cac8a8260ba590439b9a Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Sat, 14 Nov 2020 06:40:00 +0800 Subject: [PATCH] test(Layout): update test cases --- .../test/__snapshots__/index.legacy.js.snap | 22 --------- src/col/test/__snapshots__/index.spec.js.snap | 28 +++++++++++ src/col/test/index.legacy.js | 48 ------------------- src/col/test/index.spec.js | 43 +++++++++++++++++ 4 files changed, 71 insertions(+), 70 deletions(-) delete mode 100644 src/col/test/__snapshots__/index.legacy.js.snap create mode 100644 src/col/test/__snapshots__/index.spec.js.snap delete mode 100644 src/col/test/index.legacy.js create mode 100644 src/col/test/index.spec.js diff --git a/src/col/test/__snapshots__/index.legacy.js.snap b/src/col/test/__snapshots__/index.legacy.js.snap deleted file mode 100644 index 2d4588095..000000000 --- a/src/col/test/__snapshots__/index.legacy.js.snap +++ /dev/null @@ -1,22 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`gutter prop 1`] = ` -
-
24
-
12
-
12
-
8
-
8
-
8
-
6
-
6
-
6
-
6
-
7
-
6
-
5
-
4
-
3
-
2
-
-`; diff --git a/src/col/test/__snapshots__/index.spec.js.snap b/src/col/test/__snapshots__/index.spec.js.snap new file mode 100644 index 000000000..d0244eeca --- /dev/null +++ b/src/col/test/__snapshots__/index.spec.js.snap @@ -0,0 +1,28 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render Col correcly 1`] = ` +
+ +
+`; + +exports[`should render gutter correctly 1`] = ` +
+
24
+
12
+
12
+
8
+
8
+
8
+
6
+
6
+
6
+
6
+
7
+
6
+
5
+
4
+
3
+
2
+
+`; diff --git a/src/col/test/index.legacy.js b/src/col/test/index.legacy.js deleted file mode 100644 index e449ce633..000000000 --- a/src/col/test/index.legacy.js +++ /dev/null @@ -1,48 +0,0 @@ -import Col from '..'; -import Row from '../../row'; -import { mount } from '@vue/test-utils'; - -test('Col click event', () => { - const wrapper = mount(Col); - wrapper.trigger('click'); - - expect(wrapper.emitted('click')).toBeTruthy(); -}); - -test('Row click event', () => { - const wrapper = mount(Row); - wrapper.trigger('click'); - - expect(wrapper.emitted('click')).toBeTruthy(); -}); - -test('gutter prop', () => { - const wrapper = mount({ - template: ` - - 24 - - 12 - 12 - - 8 - 8 - 8 - - 6 - 6 - 6 - 6 - - 7 - 6 - 5 - 4 - 3 - 2 - - `, - }); - - expect(wrapper.html()).toMatchSnapshot(); -}); diff --git a/src/col/test/index.spec.js b/src/col/test/index.spec.js new file mode 100644 index 000000000..8dea7eacc --- /dev/null +++ b/src/col/test/index.spec.js @@ -0,0 +1,43 @@ +import Col from '..'; +import Row from '../../row'; +import { mount } from '@vue/test-utils'; + +test('should render Col correcly', () => { + const wrapper = mount(Col, { + props: { + span: 8, + }, + }); + expect(wrapper.html()).toMatchSnapshot(); +}); + +test('should render gutter correctly', () => { + const wrapper = mount({ + render: () => ( + + 24 + + 12 + 12 + + 8 + 8 + 8 + + 6 + 6 + 6 + 6 + + 7 + 6 + 5 + 4 + 3 + 2 + + ), + }); + + expect(wrapper.html()).toMatchSnapshot(); +});