2563-supplier_fiscalData + e2e #439

Merged
carlosjr merged 16 commits from 2563-supplier_fiscalData into dev 2020-11-05 08:07:53 +00:00
2 changed files with 11 additions and 3 deletions
Showing only changes of commit 61e63cdd48 - Show all commits

View File

@ -7,7 +7,7 @@ describe('Supplier getSummary()', () => {
expect(supplier.id).toEqual(1);
expect(supplier.name).toEqual('Plants SL');
expect(supplier.nif).toEqual('06089160W');
expect(supplier.account).toEqual('4000000001');
expect(supplier.account).toEqual('4100000001');
expect(supplier.payDay).toEqual(15);
});

View File

@ -1,4 +1,5 @@
const app = require('vn-loopback/server/server');
const LoopBackContext = require('loopback-context');
describe('Supplier updateFiscalData', () => {
const supplierId = 1;
@ -7,7 +8,7 @@ describe('Supplier updateFiscalData', () => {
const defaultData = {
name: 'Plants SL',
nif: '06089160W',
account: '4000000001',
account: '4100000001',
sageTaxTypeFk: 4,
sageWithholdingFk: 1,
sageTransactionTypeFk: 1,
@ -46,7 +47,14 @@ describe('Supplier updateFiscalData', () => {
});
it('should update the supplier fiscal data and return the count if changes made', async() => {
const ctx = {req: {accessToken: {userId: administrativeId}}};
const activeCtx = {
accessToken: {userId: administrativeId},
};
const ctx = {req: activeCtx};
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
active: activeCtx
});
ctx.args = {
name: 'Weapon Dealer',
nif: 'B11111111',