test: fix CI

This commit is contained in:
Benjy Cui 2017-10-24 14:08:39 +08:00
parent 9181db8a01
commit 67be1eafa9
2 changed files with 12 additions and 2 deletions

View File

@ -120,6 +120,11 @@ export default class Calendar extends React.Component<CalendarProps, CalendarSta
);
}
getDefaultLocale() {
const locale = require('./locale/en_US');
return locale.default || locale;
}
setValue = (value, way: 'select' | 'changePanel') => {
if (!('value' in this.props)) {
this.setState({ value });
@ -208,7 +213,7 @@ export default class Calendar extends React.Component<CalendarProps, CalendarSta
return (
<LocaleReceiver
componentName="Calendar"
defaultLocale={() => require('./locale/en_US')}
defaultLocale={this.getDefaultLocale}
>
{this.renderCalendar}
</LocaleReceiver>

View File

@ -54,6 +54,11 @@ export default function wrapPicker(Picker, defaultFormat?: string): any {
}
}
getDefaultLocale() {
const locale = require('./locale/en_US');
return locale.default || locale;
}
renderPicker = (locale, localeCode) => {
const props = this.props;
const { prefixCls, inputPrefixCls } = props;
@ -102,7 +107,7 @@ export default function wrapPicker(Picker, defaultFormat?: string): any {
return (
<LocaleReceiver
componentName="DatePicker"
defaultLocale={() => require('./locale/en_US')}
defaultLocale={this.getDefaultLocale}
>
{this.renderPicker}
</LocaleReceiver>