feat(Field): fix render error when value is null or undefined (#6419)

This commit is contained in:
lazy1993
2020-05-30 20:34:52 +08:00
committed by GitHub
parent 754e8994a0
commit ba04660ed3
3 changed files with 41 additions and 1 deletions
+22
View File
@@ -310,6 +310,28 @@ test('reach max word-limit', () => {
expect(wrapper).toMatchSnapshot();
});
test('reach max word-limit undefined', () => {
const wrapper = mount(Field, {
propsData: {
value: undefined,
maxlength: 3,
showWordLimit: true,
},
});
expect(wrapper).toMatchSnapshot();
});
test('reach max word-limit null', () => {
const wrapper = mount(Field, {
propsData: {
value: null,
maxlength: 3,
showWordLimit: true,
},
});
expect(wrapper).toMatchSnapshot();
});
test('name prop', () => {
const wrapper = mount(Field, {
propsData: {