31 lines
947 B
JavaScript
31 lines
947 B
JavaScript
import './index.js';
|
|
|
|
describe('Zone Component vnZone', () => {
|
|
let controller;
|
|
|
|
beforeEach(ngModule('zone'));
|
|
|
|
beforeEach(inject($componentController => {
|
|
const $element = angular.element('<vn-zone></vn-zone>');
|
|
controller = $componentController('vnZone', {$element});
|
|
}));
|
|
|
|
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});
|
|
});
|
|
|
|
it('should return a formated object with the agencyModeFk in case of agencyModeFk', () => {
|
|
let param = 'agencyModeFk';
|
|
let value = 'My Delivery';
|
|
let result = controller.exprBuilder(param, value);
|
|
|
|
expect(result).toEqual({agencyModeFk: 'My Delivery'});
|
|
});
|
|
});
|
|
});
|