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

30 lines
809 B
JavaScript
Raw Normal View History

2020-02-05 12:37:36 +00:00
import './index';
describe('vnRouteDescriptorPopover', () => {
let controller;
2020-04-25 09:50:04 +00:00
let $httpBackend;
2020-02-05 12:37:36 +00:00
beforeEach(ngModule('route'));
2020-04-25 09:50:04 +00:00
beforeEach(inject(($componentController, _$httpBackend_) => {
2020-02-05 12:37:36 +00:00
$httpBackend = _$httpBackend_;
2020-04-25 09:50:04 +00:00
controller = $componentController('vnRouteDescriptorPopover', {
$element: null,
$transclude: null
2020-02-05 12:37:36 +00:00
});
2020-04-25 09:50:04 +00:00
}));
2020-02-05 12:37:36 +00:00
2020-04-25 09:50:04 +00:00
describe('loadData()', () => {
2020-02-05 12:37:36 +00:00
it(`should perform a get query to store the client data into the controller`, () => {
2020-04-25 09:50:04 +00:00
const id = 1;
const response = 'foo';
2020-02-05 12:37:36 +00:00
2020-04-25 09:50:04 +00:00
$httpBackend.expectGET(`Routes/${id}`).respond(response);
controller.id = id;
2020-02-05 12:37:36 +00:00
$httpBackend.flush();
expect(controller.route).toEqual(response);
});
});
});