web/satellite/tests/unit/common: Fix hardcoded year check
Don't use a hardcoded year number for tests which depends on the current year for avoiding that they don't pass when a new year starts. Change-Id: I52b6248f6c3ddd2df89a4b04caf3a228b0d564e0
This commit is contained in:
parent
3e873158f4
commit
105a9a4848
@ -117,13 +117,15 @@ describe('VDatePicker.vue', () => {
|
||||
wrapper.find('.year-selection').trigger('click');
|
||||
|
||||
expect(wrapper.findAll('.year').length).toBe(100);
|
||||
expect(wrapper.findAll('.year').at(0).text()).toBe('2019');
|
||||
|
||||
const currentYear = (new Date()).getFullYear()
|
||||
expect(wrapper.findAll('.year').at(0).text()).toBe(currentYear.toString());
|
||||
|
||||
wrapper.find('.year-selection').trigger('click');
|
||||
wrapper.findAll('.year').at(1).trigger('click');
|
||||
|
||||
expect(wrapper.vm.selectedDateState.year).toBe(2018);
|
||||
expect(wrapper.find('.year-selection').text()).toBe('2018');
|
||||
expect(wrapper.vm.selectedDateState.year).toBe(currentYear-1);
|
||||
expect(wrapper.find('.year-selection').text()).toBe((currentYear-1).toString());
|
||||
});
|
||||
|
||||
it('triggers correct functionality on month incrementation', function () {
|
||||
|
Loading…
Reference in New Issue
Block a user