salix/back/methods/campaign/spec/upcoming.spec.js

13 lines
441 B
JavaScript
Raw Normal View History

2020-10-05 06:50:07 +00:00
const app = require('vn-loopback/server/server');
describe('campaign upcoming()', () => {
it('should return the upcoming campaign but from the last year', async() => {
2020-11-04 13:38:15 +00:00
const response = await app.models.Campaign.upcoming();
2020-10-05 06:50:07 +00:00
const campaignDated = response.dated;
2020-11-04 13:38:15 +00:00
const now = new Date();
2020-10-05 06:50:07 +00:00
2020-11-04 13:38:15 +00:00
expect(campaignDated).toEqual(jasmine.any(Date));
expect(campaignDated).toBeLessThanOrEqual(now);
2020-10-05 06:50:07 +00:00
});
});