feat(CheckboxGroup): add icon-size prop (#4530)

This commit is contained in:
neverland
2019-09-22 17:26:56 +08:00
committed by GitHub
parent 314cfa6a14
commit 3f4ec83145
5 changed files with 42 additions and 8 deletions
@@ -1,5 +1,22 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`icon-size prop 1`] = `
<div class="van-checkbox-group">
<div role="checkbox" tabindex="0" aria-checked="false" class="van-checkbox">
<div class="van-checkbox__icon van-checkbox__icon--round" style="font-size: 10rem;"><i class="van-icon van-icon-success">
<!----></i></div><span class="van-checkbox__label">label</span>
</div>
<div role="checkbox" tabindex="0" aria-checked="false" class="van-checkbox">
<div class="van-checkbox__icon van-checkbox__icon--round" style="font-size: 10rem;"><i class="van-icon van-icon-success">
<!----></i></div><span class="van-checkbox__label">label</span>
</div>
<div role="checkbox" tabindex="0" aria-checked="false" class="van-checkbox">
<div class="van-checkbox__icon van-checkbox__icon--round" style="font-size: 5rem;"><i class="van-icon van-icon-success">
<!----></i></div><span class="van-checkbox__label">label</span>
</div>
</div>
`;
exports[`label disabled 1`] = `
<div role="checkbox" tabindex="0" aria-checked="undefined" class="van-checkbox">
<div class="van-checkbox__icon van-checkbox__icon--round"><i class="van-icon van-icon-success">
+21 -7
View File
@@ -1,7 +1,11 @@
import Vue from 'vue';
import Checkbox from '..';
import CheckboxGroup from '../../checkbox-group';
import { mount, later } from '../../../test/utils';
Vue.use(Checkbox);
Vue.use(CheckboxGroup);
test('switch checkbox', async () => {
const wrapper = mount(Checkbox);
@@ -47,14 +51,10 @@ test('label disabled', () => {
test('checkbox group', async () => {
const wrapper = mount({
template: `
<checkbox-group v-model="result" :max="2">
<checkbox v-for="item in list" :key="item" :name="item"></checkbox>
</checkbox-group>
<van-checkbox-group v-model="result" :max="2">
<van-checkbox v-for="item in list" :key="item" :name="item"></van-checkbox>
</van-checkbox-group>
`,
components: {
Checkbox,
CheckboxGroup
},
data() {
return {
result: [],
@@ -105,3 +105,17 @@ test('label-position prop', () => {
expect(wrapper).toMatchSnapshot();
});
test('icon-size prop', () => {
const wrapper = mount({
template: `
<van-checkbox-group icon-size="10rem">
<van-checkbox>label</van-checkbox>
<van-checkbox>label</van-checkbox>
<van-checkbox icon-size="5rem">label</van-checkbox>
</van-checkbox-group>
`
});
expect(wrapper).toMatchSnapshot();
});