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

27 lines
755 B
JavaScript
Raw Normal View History

import './index';
describe('vnClientDescriptor', () => {
2020-04-25 09:50:04 +00:00
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('vnClientDescriptor', {$element: null});
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);
});
});
});