salix/modules/zone/front/main/index.spec.js

31 lines
947 B
JavaScript
Raw Normal View History

2018-09-19 13:05:07 +00:00
import './index.js';
2020-03-16 17:08:44 +00:00
describe('Zone Component vnZone', () => {
2019-04-26 14:10:51 +00:00
let controller;
2020-02-25 07:08:13 +00:00
beforeEach(ngModule('zone'));
2019-04-26 14:10:51 +00:00
2020-07-23 14:46:16 +00:00
beforeEach(inject($componentController => {
const $element = angular.element('<vn-zone></vn-zone>');
2020-03-16 17:08:44 +00:00
controller = $componentController('vnZone', {$element});
2019-04-26 14:10:51 +00:00
}));
describe('exprBuilder()', () => {
it('should return a formated object with the id in case of search', () => {
let param = 'search';
let value = 1;
let result = controller.exprBuilder(param, value);
expect(result).toEqual({id: 1});
});
2019-10-25 11:29:05 +00:00
it('should return a formated object with the agencyModeFk in case of agencyModeFk', () => {
2019-04-26 14:10:51 +00:00
let param = 'agencyModeFk';
let value = 'My Delivery';
let result = controller.exprBuilder(param, value);
expect(result).toEqual({agencyModeFk: 'My Delivery'});
2018-09-19 13:05:07 +00:00
});
});
});