feat(Tabbar): add placeholder prop (#5979)

This commit is contained in:
neverland
2020-04-01 20:41:04 +08:00
committed by GitHub
parent 0698872285
commit 02e67fdd47
7 changed files with 70 additions and 17 deletions
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`placeholder prop 1`] = `
<div class="van-nav-bar__placeholder" style="height: 0px;">
<div class="van-nav-bar__placeholder" style="height: 50px;">
<div class="van-nav-bar van-nav-bar--fixed van-hairline--bottom">
<div class="van-nav-bar__left"></div>
<div class="van-nav-bar__title van-ellipsis"></div>
+5 -1
View File
@@ -1,5 +1,5 @@
import NavBar from '..';
import { mount } from '../../../test';
import { mount, mockGetBoundingClientRect } from '../../../test';
test('render left & right slot', () => {
const wrapper = mount(NavBar, {
@@ -23,6 +23,8 @@ test('render title slot', () => {
});
test('placeholder prop', () => {
const restore = mockGetBoundingClientRect({ height: 50 });
const wrapper = mount(NavBar, {
propsData: {
fixed: true,
@@ -31,6 +33,8 @@ test('placeholder prop', () => {
});
expect(wrapper).toMatchSnapshot();
restore();
});
test('click-left event', () => {