Browse Source

test: update snap

pull/5333/head
tangjinzhou 3 years ago
parent
commit
2bafbb104c
  1. 2
      components/calendar/demo/customize-header.vue
  2. 4
      components/calendar/generateCalendar.tsx
  3. 8
      components/date-picker/generatePicker/generateSinglePicker.tsx
  4. 4
      components/input/__tests__/__snapshots__/demo.test.js.snap
  5. 2
      components/input/__tests__/demo.test.js

2
components/calendar/demo/customize-header.vue

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

4
components/calendar/generateCalendar.tsx

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

8
components/date-picker/generatePicker/generateSinglePicker.tsx

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

4
components/input/__tests__/__snapshots__/demo.test.js.snap

@ -33,8 +33,8 @@ exports[`renders ./components/input/demo/allow-clear.vue correctly 1`] = `
`; `;
exports[`renders ./components/input/demo/autosize-textarea.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><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; 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; overflow-y: hidden; resize: none; overflow-x: hidden;"></textarea>
</div> </div>
`; `;

2
components/input/__tests__/demo.test.js

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

Loading…
Cancel
Save