From e7d9cae593f7fe120d56c898282b94e5bdcd2dc4 Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Sun, 8 Nov 2020 16:18:21 +0800 Subject: [PATCH] test(NavBar): improve test cases name --- .../test/__snapshots__/index.spec.js.snap | 20 +++++++++---------- src/nav-bar/test/index.spec.js | 8 ++++---- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/nav-bar/test/__snapshots__/index.spec.js.snap b/src/nav-bar/test/__snapshots__/index.spec.js.snap index 9598fcd54..cd19791ed 100644 --- a/src/nav-bar/test/__snapshots__/index.spec.js.snap +++ b/src/nav-bar/test/__snapshots__/index.spec.js.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`should allow render left/right slot 1`] = ` +exports[`should render left/right slot and match snapshot 1`] = `
Custom Left
@@ -10,15 +10,7 @@ exports[`should allow render left/right slot 1`] = `
`; -exports[`should allow render title slot 1`] = ` -
-
-
Custom Title
-
-
-`; - -exports[`should render placeholder element when enabling placeholder prop 1`] = ` +exports[`should render placeholder element when using placeholder prop 1`] = `
@@ -27,3 +19,11 @@ exports[`should render placeholder element when enabling placeholder prop 1`] =
`; + +exports[`should render title slot and match snapshot 1`] = ` +
+
+
Custom Title
+
+
+`; diff --git a/src/nav-bar/test/index.spec.js b/src/nav-bar/test/index.spec.js index 59eb2176b..98f134ee9 100644 --- a/src/nav-bar/test/index.spec.js +++ b/src/nav-bar/test/index.spec.js @@ -1,7 +1,7 @@ import NavBar from '..'; import { mount, mockGetBoundingClientRect } from '../../../test'; -test('should allow render left/right slot', () => { +test('should render left/right slot and match snapshot', () => { const wrapper = mount(NavBar, { scopedSlots: { left: () => 'Custom Left', @@ -12,7 +12,7 @@ test('should allow render left/right slot', () => { expect(wrapper).toMatchSnapshot(); }); -test('should allow render title slot', () => { +test('should render title slot and match snapshot', () => { const wrapper = mount(NavBar, { scopedSlots: { title: () => 'Custom Title', @@ -22,7 +22,7 @@ test('should allow render title slot', () => { expect(wrapper).toMatchSnapshot(); }); -test('should render placeholder element when enabling placeholder prop', () => { +test('should render placeholder element when using placeholder prop', () => { const restore = mockGetBoundingClientRect({ height: 50 }); const wrapper = mount(NavBar, { @@ -59,7 +59,7 @@ test('should emit click-right event when clicking right text', () => { expect(wrapper.emitted('click-right')).toBeTruthy(); }); -test('should add safe-area-inset-top classname when using safe-area-inset-top prop', () => { +test('should have safe-area-inset-top class when using safe-area-inset-top prop', () => { const wrapper = mount(NavBar, { propsData: { safeAreaInsetTop: true,