30 lines
817 B
JavaScript
30 lines
817 B
JavaScript
import './index.js';
|
|
|
|
describe('vnWorkerDescriptorPopover', () => {
|
|
let controller;
|
|
let $httpBackend;
|
|
|
|
beforeEach(ngModule('worker'));
|
|
|
|
beforeEach(inject(($componentController, _$httpBackend_) => {
|
|
$httpBackend = _$httpBackend_;
|
|
controller = $componentController('vnWorkerDescriptorPopover', {
|
|
$element: null,
|
|
$transclude: null
|
|
});
|
|
}));
|
|
|
|
describe('loadData()', () => {
|
|
it(`should perform a get query to store the worker data into the controller`, () => {
|
|
const id = 1;
|
|
const response = 'foo';
|
|
|
|
$httpBackend.expectGET(`Workers/${id}`).respond(response);
|
|
controller.id = id;
|
|
$httpBackend.flush();
|
|
|
|
expect(controller.worker).toEqual(response);
|
|
});
|
|
});
|
|
});
|