2883-invoiceIn-Booking #786

Merged
carlosjr merged 17 commits from 2883-invoiceIn-Booking into dev 2022-01-24 15:29:57 +00:00
1 changed files with 6 additions and 2 deletions
Showing only changes of commit f669e7148c - Show all commits

View File

@ -8,7 +8,9 @@ describe('vnInvoiceInDescriptor', () => {
beforeEach(inject(($componentController, _$httpBackend_) => {
$httpBackend = _$httpBackend_;
controller = $componentController('vnInvoiceInDescriptor', {$element: null});
const $element = angular.element('<vn-invoice-in-descriptor></vn-invoice-in-descriptor>');
controller = $componentController('vnInvoiceInDescriptor', {$element});
controller.invoiceIn = {id: 1};
$httpBackend.when('GET', `InvoiceIns/${controller.invoiceIn.id}`).respond({id: 1});
}));
@ -21,7 +23,9 @@ describe('vnInvoiceInDescriptor', () => {
describe('onAcceptToBook()', () => {
it(`should perform a post query to book the invoice`, () => {
controller.vnApp = {showSuccess: jest.fn()};
jest.spyOn(controller.vnApp, 'showSuccess');
controller.$state.reload = jest.fn();
const id = 1;
$httpBackend.expectPOST(`InvoiceIns/${id}/toBook`).respond();