Skip to content

Commit

Permalink
Fix prop locale not working in DatePicker/RangePicker
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 committed Dec 17, 2017
1 parent 9cdae00 commit 0ecb6ad
Show file tree
Hide file tree
Showing 3 changed files with 848 additions and 2 deletions.
46 changes: 46 additions & 0 deletions components/date-picker/__tests__/DatePicker.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,52 @@
import React from 'react';
import { mount } from 'enzyme';
import DatePicker from '..';
import focusTest from '../../../tests/shared/focusTest';

describe('DatePicker', () => {
focusTest(DatePicker);

it('prop locale should works', () => {
const locale = {
lang: {
placeholder: 'Избери дата',
rangePlaceholder: [
'Начална дата',
'Крайна дата',
],
today: 'Днес',
now: 'Сега',
backToToday: 'Към днес',
ok: 'Добре',
clear: 'Изчистване',
month: 'Месец',
year: 'Година',
timeSelect: 'Избор на час',
dateSelect: 'Избор на дата',
monthSelect: 'Избор на месец',
yearSelect: 'Избор на година',
decadeSelect: 'Десетилетие',
previousMonth: 'Предишен месец (PageUp)',
nextMonth: 'Следващ месец (PageDown)',
previousYear: 'Последна година (Control + left)',
nextYear: 'Следваща година (Control + right)',
previousDecade: 'Предишно десетилетие',
nextDecade: 'Следващо десетилетие',
previousCentury: 'Последен век',
nextCentury: 'Следващ век',
yearFormat: 'YYYY',
dateFormat: 'D M YYYY',
dayFormat: 'D',
dateTimeFormat: 'D M YYYY HH:mm:ss',
monthBeforeYear: true,
},
timePickerLocale: {
placeholder: 'Избор на час',
},
};
const wrapper = mount(
<DatePicker open locale={locale} />
);
expect(wrapper.render()).toMatchSnapshot();
});
});
Loading

0 comments on commit 0ecb6ad

Please sign in to comment.