salix/modules/zone/front/upcoming-deliveries/index.spec.js

23 lines
701 B
JavaScript
Raw Normal View History

2020-05-19 06:46:42 +00:00
import './index';
describe('component vnUpcomingDeliveries', () => {
let $scope;
let controller;
beforeEach(ngModule('zone'));
beforeEach(angular.mock.inject(($componentController, $rootScope) => {
$scope = $rootScope.$new();
const $element = angular.element(`<vn-upcoming-deliveries></vn-upcoming-deliveries>`);
controller = $componentController('vnUpcomingDeliveries', {$element, $scope});
}));
2020-05-19 10:50:43 +00:00
describe('getWeekDay()', () => {
2020-05-19 06:46:42 +00:00
it('should retrieve a weekday for a json passed', () => {
let jsonDate = '1970-01-01T22:00:00.000Z';
expect(controller.getWeekDay(jsonDate)).toEqual('Thursday');
});
});
});