Search组件新增微杂志样式 (#38)

* search component add new style
This commit is contained in:
张敏
2017-06-09 14:52:08 +08:00
committed by GitHub
parent e15d0d504b
commit cfe9ebaf86
5 changed files with 99 additions and 4 deletions

View File

@@ -92,4 +92,25 @@ describe('Search', () => {
done();
});
});
it('create a showcase type search', () => {
wrapper = mount(Search, {
propsData: {
type: 'showcase'
}
});
expect(wrapper.hasClass('van-search')).to.be.true;
expect(wrapper.hasClass('van-search--showcase')).to.be.true;
const input = wrapper.find('.van-search__input')[0];
input.simulate('focus');
expect(wrapper.data().isFocus).to.be.true;
const body = document.body;
body.click();
expect(wrapper.data().isFocus).to.be.false;
expect(wrapper.data().focusStatus).to.be.false;
});
});