Test fix
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
47b845da46
commit
c77cd696c7
|
@ -2,15 +2,11 @@ const app = require('vn-loopback/server/server');
|
||||||
|
|
||||||
describe('campaign upcoming()', () => {
|
describe('campaign upcoming()', () => {
|
||||||
it('should return the upcoming campaign but from the last year', async() => {
|
it('should return the upcoming campaign but from the last year', async() => {
|
||||||
let response = await app.models.Campaign.upcoming();
|
const response = await app.models.Campaign.upcoming();
|
||||||
|
|
||||||
const lastYearDate = new Date();
|
|
||||||
lastYearDate.setFullYear(lastYearDate.getFullYear() - 1);
|
|
||||||
const lastYear = lastYearDate.getFullYear();
|
|
||||||
|
|
||||||
const campaignDated = response.dated;
|
const campaignDated = response.dated;
|
||||||
const campaignYear = campaignDated.getFullYear();
|
const now = new Date();
|
||||||
|
|
||||||
expect(campaignYear).toEqual(lastYear);
|
expect(campaignDated).toEqual(jasmine.any(Date));
|
||||||
|
expect(campaignDated).toBeLessThanOrEqual(now);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue