salix/modules/route/front/descriptor/index.spec.js

27 lines
758 B
JavaScript

import './index';
describe('vnRouteDescriptorPopover', () => {
let controller;
let $httpBackend;
beforeEach(ngModule('route'));
beforeEach(inject(($componentController, _$httpBackend_) => {
$httpBackend = _$httpBackend_;
controller = $componentController('vnRouteDescriptor', {$element: null});
}));
describe('loadData()', () => {
it(`should perform a get query to store the client data into the controller`, () => {
const id = 1;
const response = 'foo';
$httpBackend.expectRoute('GET', `Routes/${id}`).respond(response);
controller.id = id;
$httpBackend.flush();
expect(controller.route).toEqual(response);
});
});
});