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

27 lines
773 B
JavaScript

import './index';
describe('vnInvoiceOutDescriptor', () => {
let controller;
let $httpBackend;
beforeEach(ngModule('invoiceOut'));
beforeEach(inject(($componentController, _$httpBackend_) => {
$httpBackend = _$httpBackend_;
controller = $componentController('vnInvoiceOutDescriptor', {$element: null});
}));
describe('loadData()', () => {
it(`should perform a get query to store the invoice in data into the controller`, () => {
const id = 1;
const response = {id: 1};
$httpBackend.expectGET(`InvoiceOuts/${id}`).respond(response);
controller.id = id;
$httpBackend.flush();
expect(controller.invoiceOut).toEqual(response);
});
});
});