forked from ant-design/ant-design
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix prop locale not working in DatePicker/RangePicker
close ant-design#8635
- Loading branch information
Showing
3 changed files
with
848 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}); | ||
}); |
Oops, something went wrong.