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

30 lines
822 B
JavaScript
Raw Normal View History

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