docs(Search): update document (#4414)

This commit is contained in:
neverland
2019-09-10 17:34:58 +08:00
committed by GitHub
parent f6f696ff73
commit 4192ef198e
9 changed files with 37 additions and 40 deletions
@@ -1,10 +1,11 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`left-icon prop 1`] = `
exports[`label slot 1`] = `
<div class="van-search" style="background: rgb(255, 255, 255);">
<div class="van-search__content van-search__content--square">
<div class="van-search__label">Custom Label</div>
<div class="van-cell van-cell--borderless van-field">
<div class="van-field__left-icon"><i class="van-icon van-icon-setting-o">
<div class="van-field__left-icon"><i class="van-icon van-icon-search">
<!----></i></div>
<div class="van-cell__value van-cell__value--alone">
<div class="van-field__body"><input type="search" class="van-field__control"></div>
@@ -14,12 +15,11 @@ exports[`left-icon prop 1`] = `
</div>
`;
exports[`render label slot 1`] = `
exports[`left-icon prop 1`] = `
<div class="van-search" style="background: rgb(255, 255, 255);">
<div class="van-search__content van-search__content--square">
<div class="van-search__label">Custom Label</div>
<div class="van-cell van-cell--borderless van-field">
<div class="van-field__left-icon"><i class="van-icon van-icon-search">
<div class="van-field__left-icon"><i class="van-icon van-icon-setting-o">
<!----></i></div>
<div class="van-cell__value van-cell__value--alone">
<div class="van-field__body"><input type="search" class="van-field__control"></div>
+4 -4
View File
@@ -1,7 +1,7 @@
import Search from '..';
import { mount } from '../../../test/utils';
test('listen input event', () => {
test('input event', () => {
const onInput = jest.fn();
const wrapper = mount(Search, {
context: {
@@ -18,7 +18,7 @@ test('listen input event', () => {
expect(onInput).toHaveBeenCalledWith('1');
});
test('cancel search', () => {
test('cancel event', () => {
const onInput = jest.fn();
const onCancel = jest.fn();
@@ -42,7 +42,7 @@ test('cancel search', () => {
expect(onCancel).toHaveBeenCalled();
});
test('emit a search event', () => {
test('search event', () => {
const onSearch = jest.fn();
const onKeypress = jest.fn();
@@ -63,7 +63,7 @@ test('emit a search event', () => {
expect(onKeypress).toHaveBeenCalled();
});
test('render label slot', () => {
test('label slot', () => {
const wrapper = mount(Search, {
scopedSlots: {
label() {