onAcceptToBook test ok
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
d0326fe354
commit
f669e7148c
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue