2534 - Fill sage data before enable taxDataChecked #432
|
@ -157,5 +157,5 @@
|
|||
"landed": "F. entrega",
|
||||
"addressFk": "Consignatario",
|
||||
"companyFk": "Empresa",
|
||||
"You need to fill sage information before you check verified data": "You need to fill sage information before you check verified data"
|
||||
"You need to fill sage information before you check verified data": "Debes rellenar la información de sage antes de marcar datos comprobados"
|
||||
}
|
|
@ -2,10 +2,11 @@ const app = require('vn-loopback/server/server');
|
|||
|
||||
describe('Client updateFiscalData', () => {
|
||||
const clientId = 101;
|
||||
const employeeId = 1;
|
||||
const salesAssistantId = 21;
|
||||
const administrativeId = 5;
|
||||
afterAll(async done => {
|
||||
const ctx = {req: {accessToken: {userId: 5}}};
|
||||
const ctx = {req: {accessToken: {userId: administrativeId}}};
|
||||
ctx.args = {postcode: 46460};
|
||||
|
||||
await app.models.Client.updateFiscalData(ctx, clientId);
|
||||
|
@ -13,8 +14,8 @@ describe('Client updateFiscalData', () => {
|
|||
done();
|
||||
});
|
||||
|
||||
it('should return an error if the user is not administrative and the isTaxDataChecked value is true', async() => {
|
||||
const ctx = {req: {accessToken: {userId: 1}}};
|
||||
it('should return an error if the user is not salesAssistant and the isTaxDataChecked value is true', async() => {
|
||||
const ctx = {req: {accessToken: {userId: employeeId}}};
|
||||
ctx.args = {};
|
||||
|
||||
let error;
|
||||
|
@ -26,7 +27,7 @@ describe('Client updateFiscalData', () => {
|
|||
expect(error.message).toEqual(`You can't make changes on a client with verified data`);
|
||||
});
|
||||
|
||||
joan marked this conversation as resolved
|
||||
it('should return an error if the user is not d and the isTaxDataChecked value is true', async() => {
|
||||
it('should return an error if the salesAssistant did not fill the sage data before checking verified data', async() => {
|
||||
const client = await app.models.Client.findById(clientId);
|
||||
await client.updateAttribute('isTaxDataChecked', false);
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
data="sageTransactionTypes"
|
||||
order="transaction">
|
||||
</vn-crud-model>
|
||||
<form name="form" ng-submit="$ctrl.onSubmit()" class="vn-w-md" disabled="true">
|
||||
<form name="form" ng-submit="$ctrl.onSubmit()" class="vn-w-md">
|
||||
carlosjr
commented
disabled not needed disabled not needed
|
||||
<vn-card class="vn-pa-lg">
|
||||
<vn-horizontal>
|
||||
<vn-textfield
|
||||
|
|
Loading…
Reference in New Issue
who is d?