test: update snap

pull/5333/head
tangjinzhou 2022-03-12 16:28:36 +08:00
parent b3a0263c03
commit 2bafbb104c
5 changed files with 11 additions and 9 deletions

View File

@ -57,7 +57,7 @@ Customize Calendar header content.
:value="String(current.month())"
@change="
selectedMonth => {
onChange(current.month(parseInt(selectedMonth, 10)));
onChange(current.month(parseInt(String(selectedMonth), 10)));
}
"
>

View File

@ -127,7 +127,7 @@ function generateCalendar<
? (generateConfig.toDate(props.value, props.valueFormat) as DateType)
: (props.value as DateType);
}
return null;
return (props.value === '' ? undefined : props.value) as DateType;
});
const defaultValue = computed(() => {
if (props.defaultValue) {
@ -135,7 +135,7 @@ function generateCalendar<
? (generateConfig.toDate(props.defaultValue, props.valueFormat) as DateType)
: (props.defaultValue as DateType);
}
return null;
return (props.defaultValue === '' ? undefined : props.defaultValue) as DateType;
});
// Value

View File

@ -119,7 +119,7 @@ export default function generateSinglePicker<DateType, ExtraProps = {}>(
? generateConfig.toDate(props.value as string | DateType, props.valueFormat)
: props.value;
}
return null;
return (props.value === '' ? undefined : props.value) as DateType;
});
const defaultValue = computed(() => {
if (props.defaultValue) {
@ -127,7 +127,7 @@ export default function generateSinglePicker<DateType, ExtraProps = {}>(
? generateConfig.toDate(props.defaultValue as string | DateType, props.valueFormat)
: props.defaultValue;
}
return null;
return (props.defaultValue === '' ? undefined : props.defaultValue) as DateType;
});
const defaultPickerValue = computed(() => {
if (props.defaultPickerValue) {
@ -138,7 +138,9 @@ export default function generateSinglePicker<DateType, ExtraProps = {}>(
)
: props.defaultPickerValue;
}
return null;
return (
props.defaultPickerValue === '' ? undefined : props.defaultPickerValue
) as DateType;
});
return () => {

View File

@ -33,8 +33,8 @@ exports[`renders ./components/input/demo/allow-clear.vue correctly 1`] = `
`;
exports[`renders ./components/input/demo/autosize-textarea.vue correctly 1`] = `
<div><textarea placeholder="Autosize height based on content lines" class="ant-input" style="height: 0px; min-height: -9007199254740991px; max-height: 9007199254740991px; resize: none;"></textarea>
<div style="margin: 24px 0px;"></div><textarea placeholder="Autosize height with minimum and maximum number of lines" class="ant-input" style="height: -20px; min-height: -8px; max-height: -20px; resize: none;"></textarea>
<div><textarea placeholder="Autosize height based on content lines" class="ant-input" style="height: 0px; min-height: -9007199254740991px; max-height: 9007199254740991px; overflow-y: hidden; resize: none; overflow-x: hidden;"></textarea>
<div style="margin: 24px 0px;"></div><textarea placeholder="Autosize height with minimum and maximum number of lines" class="ant-input" style="height: -20px; min-height: -8px; max-height: -20px; overflow-y: hidden; resize: none; overflow-x: hidden;"></textarea>
</div>
`;

View File

@ -1,3 +1,3 @@
import demoTest from '../../../tests/shared/demoTest';
demoTest('input');
demoTest('input', { skip: ['autosize-textarea'] });