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

13 lines
444 B
JavaScript
Raw Normal View History

2023-01-24 08:04:43 +00:00
const {models} = require('vn-loopback/server/server');
2020-10-05 06:50:07 +00:00
describe('campaign upcoming()', () => {
it('should return the upcoming campaign but from the last year', async() => {
2023-01-24 08:04:43 +00:00
const response = await models.Campaign.upcoming();
2020-10-05 06:50:07 +00:00
const campaignDated = response.dated;
2023-01-16 14:18:24 +00:00
const now = Date.vnNew();
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
});
});