Updated unit test
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Joan Sanchez 2020-08-11 12:16:19 +02:00
parent 64abd29257
commit b50b30c792
1 changed files with 16 additions and 0 deletions

View File

@ -22,6 +22,22 @@ describe('Worker', () => {
controller._worker = {id: 106}; controller._worker = {id: 106};
})); }));
describe('year() getter', () => {
it(`should return the year number of the calendar date`, () => {
expect(controller.year).toEqual(year);
});
});
describe('year() setter', () => {
it(`should set the year of the calendar date`, () => {
const previousYear = year - 1;
controller.year = previousYear;
expect(controller.year).toEqual(previousYear);
expect(controller.date.getFullYear()).toEqual(previousYear);
});
});
describe('started property', () => { describe('started property', () => {
it(`should return first day and month of current year`, () => { it(`should return first day and month of current year`, () => {
let started = new Date(year, 0, 1); let started = new Date(year, 0, 1);