[improvement] rename packages dir to src (#3659)

This commit is contained in:
neverland
2019-06-27 11:25:57 +08:00
committed by GitHub
parent 8489918dca
commit 75c79b7044
619 changed files with 21 additions and 21 deletions
@@ -0,0 +1,102 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders demo correctly 1`] = `
<div>
<div>
<div class="van-cell-group van-hairline--top-bottom">
<div class="van-cell">
<div class="van-cell__title"><span>单元格</span></div>
<div class="van-cell__value"><span>内容</span></div>
</div>
<div class="van-cell">
<div class="van-cell__title"><span>单元格</span>
<div class="van-cell__label">描述信息</div>
</div>
<div class="van-cell__value"><span>内容</span></div>
</div>
</div>
</div>
<div>
<div class="van-cell van-cell--large">
<div class="van-cell__title"><span>单元格</span></div>
<div class="van-cell__value"><span>内容</span></div>
</div>
<div class="van-cell van-cell--large">
<div class="van-cell__title"><span>单元格</span>
<div class="van-cell__label">描述信息</div>
</div>
<div class="van-cell__value"><span>内容</span></div>
</div>
</div>
<div>
<div class="van-cell"><i class="van-icon van-icon-location-o van-cell__left-icon">
<!----></i>
<div class="van-cell__title"><span>单元格</span></div>
<div class="van-cell__value"><span>内容</span></div>
</div>
</div>
<div>
<div class="van-cell">
<div class="van-cell__value van-cell__value--alone"><span>内容</span></div>
</div>
</div>
<div>
<div class="van-cell van-cell--clickable">
<div class="van-cell__title"><span>单元格</span></div><i class="van-icon van-icon-arrow van-cell__right-icon">
<!----></i>
</div>
<div class="van-cell van-cell--clickable">
<div class="van-cell__title"><span>单元格</span></div>
<div class="van-cell__value"><span>内容</span></div><i class="van-icon van-icon-arrow van-cell__right-icon">
<!----></i>
</div>
<div class="van-cell van-cell--clickable">
<div class="van-cell__title"><span>单元格</span></div>
<div class="van-cell__value"><span>内容</span></div><i class="van-icon van-icon-arrow-down van-cell__right-icon">
<!----></i>
</div>
</div>
<div>
<div class="van-cell van-cell--clickable">
<div class="van-cell__title"><span>单元格</span></div><i class="van-icon van-icon-arrow van-cell__right-icon">
<!----></i>
</div>
<div class="van-cell van-cell--clickable">
<div class="van-cell__title"><span>单元格</span></div><i class="van-icon van-icon-arrow van-cell__right-icon">
<!----></i>
</div>
</div>
<div>
<div>
<div class="van-cell-group__title">分组 1</div>
<div class="van-cell-group van-hairline--top-bottom">
<div class="van-cell">
<div class="van-cell__title"><span>单元格</span></div>
<div class="van-cell__value"><span>内容</span></div>
</div>
</div>
</div>
<div>
<div class="van-cell-group__title">分组 2</div>
<div class="van-cell-group van-hairline--top-bottom">
<div class="van-cell">
<div class="van-cell__title"><span>单元格</span></div>
<div class="van-cell__value"><span>内容</span></div>
</div>
</div>
</div>
</div>
<div>
<div class="van-cell van-cell--clickable">
<div class="van-cell__title"><span class="custom-title">单元格</span> <span class="van-tag" style="background-color: rgb(255, 68, 68);">标签</span></div>
<div class="van-cell__value"><span>内容</span></div><i class="van-icon van-icon-arrow van-cell__right-icon">
<!----></i>
</div>
<div class="van-cell"><i class="van-icon van-icon-shop-o van-cell__left-icon">
<!----></i>
<div class="van-cell__title"><span>单元格</span></div><i class="van-icon van-icon-search" style="line-height: inherit;">
<!----></i>
</div>
</div>
</div>
`;
@@ -0,0 +1,17 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`arrow direction 1`] = `
<div class="van-cell van-cell--clickable"><i class="van-icon van-icon-arrow-down van-cell__right-icon">
<!----></i></div>
`;
exports[`render slot 1`] = `
<div class="van-cell">Custom Icon<div class="van-cell__title">Custom Title<div class="van-cell__label">Custom Label</div>
</div>Custom Extra</div>
`;
exports[`title-style prop 1`] = `
<div class="van-cell">
<div class="van-cell__title" style="color: red;"><span>title</span></div>
</div>
`;
+4
View File
@@ -0,0 +1,4 @@
import Demo from '../demo';
import demoTest from '../../../test/demo-test';
demoTest(Demo);
+58
View File
@@ -0,0 +1,58 @@
import Cell from '..';
import { mount } from '../../../test/utils';
test('click event', () => {
const click = jest.fn();
const wrapper = mount(Cell, {
context: {
on: {
click
}
}
});
wrapper.trigger('click');
expect(click).toHaveBeenCalled();
});
test('arrow direction', () => {
const wrapper = mount(Cell, {
propsData: {
isLink: true,
arrowDirection: 'down'
}
});
expect(wrapper).toMatchSnapshot();
});
test('render slot', () => {
const wrapper = mount({
template: `
<cell>
<template v-slot:icon>Custom Icon</template>
<template v-slot:title>Custom Title</template>
<template v-slot:label>Custom Label</template>
<template v-slot:extra>Custom Extra</template>
</cell>
`,
components: {
Cell
}
});
expect(wrapper).toMatchSnapshot();
});
test('title-style prop', () => {
const wrapper = mount(Cell, {
propsData: {
title: 'title',
titleStyle: {
color: 'red'
}
}
});
expect(wrapper).toMatchSnapshot();
});