17 lines
561 B
JavaScript
17 lines
561 B
JavaScript
|
const app = require('vn-loopback/server/server');
|
||
|
|
||
|
describe('campaign upcoming()', () => {
|
||
|
it('should return the upcoming campaign but from the last year', async() => {
|
||
|
let response = await app.models.Campaign.upcoming();
|
||
|
|
||
|
const lastYearDate = new Date();
|
||
|
lastYearDate.setFullYear(lastYearDate.getFullYear() - 1);
|
||
|
const lastYear = lastYearDate.getFullYear();
|
||
|
|
||
|
const campaignDated = response.dated;
|
||
|
const campaignYear = campaignDated.getFullYear();
|
||
|
|
||
|
expect(campaignYear).toEqual(lastYear);
|
||
|
});
|
||
|
});
|