2021-03-03 06:44:09 +00:00
|
|
|
import './index';
|
|
|
|
|
|
|
|
describe('vnInvoiceOutDescriptor', () => {
|
|
|
|
let controller;
|
|
|
|
let $httpBackend;
|
|
|
|
|
|
|
|
beforeEach(ngModule('invoiceOut'));
|
|
|
|
|
2021-11-10 13:48:17 +00:00
|
|
|
beforeEach(inject(($componentController, _$httpBackend_) => {
|
2021-03-03 06:44:09 +00:00
|
|
|
$httpBackend = _$httpBackend_;
|
|
|
|
controller = $componentController('vnInvoiceOutDescriptor', {$element: null});
|
|
|
|
}));
|
|
|
|
|
2021-10-07 11:36:23 +00:00
|
|
|
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);
|
|
|
|
});
|
|
|
|
});
|
2021-03-03 06:44:09 +00:00
|
|
|
});
|