chore: add trailingComma
This commit is contained in:
@@ -56,13 +56,13 @@ export default {
|
||||
'zh-CN': {
|
||||
name: '张三',
|
||||
defaultLabel: '设为默认联系人',
|
||||
defaultTagText: '默认'
|
||||
defaultTagText: '默认',
|
||||
},
|
||||
'en-US': {
|
||||
name: 'John Snow',
|
||||
defaultLabel: 'Set as the default contact',
|
||||
defaultTagText: 'default'
|
||||
}
|
||||
defaultTagText: 'default',
|
||||
},
|
||||
},
|
||||
|
||||
data() {
|
||||
@@ -72,7 +72,7 @@ export default {
|
||||
showList: false,
|
||||
showEdit: false,
|
||||
isEdit: false,
|
||||
list: []
|
||||
list: [],
|
||||
};
|
||||
},
|
||||
|
||||
@@ -82,7 +82,7 @@ export default {
|
||||
name: this.$t('name'),
|
||||
tel: '13000000000',
|
||||
id: 0,
|
||||
isDefault: 1
|
||||
isDefault: 1,
|
||||
};
|
||||
},
|
||||
|
||||
@@ -93,7 +93,7 @@ export default {
|
||||
currentContact() {
|
||||
const id = this.chosenContactId;
|
||||
return id !== null ? this.list.filter(item => item.id === id)[0] : {};
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
created() {
|
||||
@@ -135,8 +135,8 @@ export default {
|
||||
if (this.chosenContactId === info.id) {
|
||||
this.chosenContactId = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ function ContactCard(
|
||||
|
||||
return [
|
||||
<div>{`${t('name')}:${props.name}`}</div>,
|
||||
<div>{`${t('tel')}:${props.tel}`}</div>
|
||||
<div>{`${t('tel')}:${props.tel}`}</div>,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -63,12 +63,12 @@ ContactCard.props = {
|
||||
addText: String,
|
||||
editable: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
default: true,
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
default: 'add'
|
||||
}
|
||||
default: 'add',
|
||||
},
|
||||
};
|
||||
|
||||
export default createComponent<ContactCardProps>(ContactCard);
|
||||
|
||||
@@ -5,7 +5,7 @@ import { mount, later } from '../../../test';
|
||||
|
||||
const contactInfo = {
|
||||
name: 'test',
|
||||
tel: '123123213'
|
||||
tel: '123123213',
|
||||
};
|
||||
|
||||
describe('ContactCard', () => {
|
||||
@@ -14,9 +14,9 @@ describe('ContactCard', () => {
|
||||
const wrapper = mount(ContactCard, {
|
||||
context: {
|
||||
on: {
|
||||
click
|
||||
}
|
||||
}
|
||||
click,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
wrapper.trigger('click');
|
||||
@@ -27,13 +27,13 @@ describe('ContactCard', () => {
|
||||
const click = jest.fn();
|
||||
const wrapper = mount(ContactCard, {
|
||||
propsData: {
|
||||
editable: false
|
||||
editable: false,
|
||||
},
|
||||
context: {
|
||||
on: {
|
||||
click
|
||||
}
|
||||
}
|
||||
click,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
wrapper.trigger('click');
|
||||
@@ -45,8 +45,8 @@ describe('ContactList', () => {
|
||||
test('render', () => {
|
||||
const wrapper = mount(ContactList, {
|
||||
propsData: {
|
||||
list: [contactInfo]
|
||||
}
|
||||
list: [contactInfo],
|
||||
},
|
||||
});
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
@@ -55,13 +55,13 @@ describe('ContactList', () => {
|
||||
const onSelect = jest.fn();
|
||||
const wrapper = mount(ContactList, {
|
||||
propsData: {
|
||||
list: [contactInfo]
|
||||
list: [contactInfo],
|
||||
},
|
||||
context: {
|
||||
on: {
|
||||
select: onSelect
|
||||
}
|
||||
}
|
||||
select: onSelect,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
wrapper.find('.van-radio__icon').trigger('click');
|
||||
@@ -74,8 +74,8 @@ describe('ContactEdit', () => {
|
||||
const createComponent = () => {
|
||||
const wrapper = mount(ContactEdit, {
|
||||
propsData: {
|
||||
contactInfo
|
||||
}
|
||||
contactInfo,
|
||||
},
|
||||
});
|
||||
|
||||
const button = wrapper.find('.van-button');
|
||||
@@ -86,7 +86,7 @@ describe('ContactEdit', () => {
|
||||
data,
|
||||
field,
|
||||
button,
|
||||
errorInfo
|
||||
errorInfo,
|
||||
};
|
||||
};
|
||||
|
||||
@@ -114,7 +114,7 @@ describe('ContactEdit', () => {
|
||||
expect(errorInfo.tel).toBeFalsy();
|
||||
expect(wrapper.emitted('save')[0][0]).toEqual({
|
||||
name: 'test',
|
||||
tel: '13000000000'
|
||||
tel: '13000000000',
|
||||
});
|
||||
});
|
||||
|
||||
@@ -127,8 +127,8 @@ describe('ContactEdit', () => {
|
||||
test('delete contact', async () => {
|
||||
const wrapper = mount(ContactEdit, {
|
||||
propsData: {
|
||||
isEdit: true
|
||||
}
|
||||
isEdit: true,
|
||||
},
|
||||
});
|
||||
|
||||
const deleteButton = wrapper.findAll('.van-button').at(1);
|
||||
|
||||
Reference in New Issue
Block a user