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

13 lines
443 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;
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
});
});