test(NavBar): update test cases

This commit is contained in:
chenjiahan
2020-11-14 07:06:21 +08:00
parent 2b34fac38d
commit 98c553de29
18 changed files with 82 additions and 73 deletions
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`should render default slot and match snapshot 1`] = `
exports[`should render default slot correctly 1`] = `
<div role="button" class="van-action-bar-icon" tabindex="0">
<div class="van-badge__wrapper van-icon van-icon-undefined van-action-bar-icon__icon">
<!---->
@@ -10,7 +10,7 @@ exports[`should render default slot and match snapshot 1`] = `
</div>
`;
exports[`should render icon slot and match snapshot 1`] = `
exports[`should render icon slot correctly 1`] = `
<div role="button" class="van-action-bar-icon" tabindex="0">
<div class="van-badge__wrapper van-action-bar-icon__icon">Custom Icon
<!---->
@@ -18,14 +18,14 @@ exports[`should render icon slot and match snapshot 1`] = `
</div>
`;
exports[`should render icon slot with badge and match snapshot 1`] = `
exports[`should render icon slot with badge correctly 1`] = `
<div role="button" class="van-action-bar-icon" tabindex="0">
<div class="van-badge__wrapper van-action-bar-icon__icon">Custom Icon<div class="van-badge van-badge--fixed">1</div>
</div>Content
</div>
`;
exports[`should render icon slot with dot and match snapshot 1`] = `
exports[`should render icon slot with dot correctly 1`] = `
<div role="button" class="van-action-bar-icon" tabindex="0">
<div class="van-badge__wrapper van-action-bar-icon__icon">Custom Icon<div class="van-badge van-badge--dot van-badge--fixed">
<!---->
+4 -4
View File
@@ -1,7 +1,7 @@
import { mount } from '@vue/test-utils';
import ActionBarIcon from '..';
test('should render default slot and match snapshot', () => {
test('should render default slot correctly', () => {
const wrapper = mount(ActionBarIcon, {
slots: {
default: 'Content',
@@ -10,7 +10,7 @@ test('should render default slot and match snapshot', () => {
expect(wrapper.html()).toMatchSnapshot();
});
test('should render icon slot and match snapshot', () => {
test('should render icon slot correctly', () => {
const wrapper = mount(ActionBarIcon, {
slots: {
default: 'Content',
@@ -21,7 +21,7 @@ test('should render icon slot and match snapshot', () => {
expect(wrapper.html()).toMatchSnapshot();
});
test('should render icon slot with badge and match snapshot', () => {
test('should render icon slot with badge correctly', () => {
const wrapper = mount(ActionBarIcon, {
props: {
badge: '1',
@@ -35,7 +35,7 @@ test('should render icon slot with badge and match snapshot', () => {
expect(wrapper.html()).toMatchSnapshot();
});
test('should render icon slot with dot and match snapshot', () => {
test('should render icon slot with dot correctly', () => {
const wrapper = mount(ActionBarIcon, {
props: {
dot: true,