From b9cec3b5a1db7e0d3c61b9d1386189d7ceabb740 Mon Sep 17 00:00:00 2001 From: Gabriele Barcella Date: Wed, 13 Nov 2024 11:39:06 +0100 Subject: [PATCH] fix: added new testes tax profile --- test/api/SettingsApi.spec.ts | 15 ++- test/model/GetTaxProfileResponse.spec.ts | 63 ++++++++++ test/model/TaxProfile.spec.ts | 140 +++++++++++++++++++++++ 3 files changed, 217 insertions(+), 1 deletion(-) create mode 100644 test/model/GetTaxProfileResponse.spec.ts create mode 100644 test/model/TaxProfile.spec.ts diff --git a/test/api/SettingsApi.spec.ts b/test/api/SettingsApi.spec.ts index 884c37a..d1c7783 100644 --- a/test/api/SettingsApi.spec.ts +++ b/test/api/SettingsApi.spec.ts @@ -12,7 +12,7 @@ import { expect } from 'chai' import { SettingsApi } from '../../src/api/settings-api' -import { CreatePaymentAccountRequest, CreatePaymentAccountResponse, CreatePaymentMethodRequest, CreatePaymentMethodResponse, GetPaymentAccountResponse, GetPaymentMethodResponse, ModifyPaymentAccountRequest, ModifyPaymentAccountResponse, ModifyPaymentMethodRequest, ModifyPaymentMethodResponse } from '../../src/models' +import { CreatePaymentAccountRequest, CreatePaymentAccountResponse, CreatePaymentMethodRequest, CreatePaymentMethodResponse, GetPaymentAccountResponse, GetPaymentMethodResponse, GetTaxProfileResponse, GetVatTypeResponse, ModifyPaymentAccountRequest, ModifyPaymentAccountResponse, ModifyPaymentMethodRequest, ModifyPaymentMethodResponse } from '../../src/models' const sandbox = require('sinon').createSandbox() @@ -42,6 +42,10 @@ const modifyPaymentAccountStub = sandbox.stub(instance, 'modifyPaymentAccount'). const modifyPaymentMethodResponse: ModifyPaymentMethodResponse = { data: { id: 386683, name: 'Bonifico bancario', is_default: true, type: 'standard', details: [{ title: 'Banca', description: 'Sao Paulo' }], default_payment_account: { id: 12345, name: 'conto banca SP' } } } const modifyPaymentMethodStub = sandbox.stub(instance, 'modifyPaymentMethod').returns(modifyPaymentMethodResponse) +const GetTaxProfileResponse: GetTaxProfileResponse = { data: {company_type: "individual",company_subtype: "artigiani",profession: "test",regime: "forfettario_5",rivalsa_name: "",default_rivalsa: 0,cassa_name: "",default_cassa: 0,default_cassa_taxable: 100,cassa2_name: "",default_cassa2: 0,default_cassa2_taxable: 0,default_withholding_tax: 0,default_withholding_tax_taxable: 100, default_other_withholding_tax: 0,enasarco: false,enasarco_type: "test", contributions_percentage: 0,med: false,default_vat: {id: 66,value: 0,description: "Contribuenti forfettari",notes: "Operazione non soggetta a IVA ai sensi dell'art. 1, commi 54-89, Legge n. 190\/2014 e succ. modifiche\/integrazioni",e_invoice: true,ei_type: "2.2",ei_description: "Non soggetta art. 1\/54-89 L. 190\/2014 e succ. modifiche\/integrazioni",editable: false,is_disabled: false,default: true}} } +sandbox.stub(instance, 'getTaxProfile').returns(GetTaxProfileResponse) + + // beforeEach(function () { // }) @@ -121,4 +125,13 @@ describe('SettingsApi', function () { done() }) }) + describe('getTaxProfile', function () { + it('should call getTaxProfile successfully', function (done) { + const response = instance.getTaxProfile(1) + const expectedJson = JSON.stringify(GetTaxProfileResponse) + const actualJson = JSON.stringify(response) + expect(actualJson).to.equal(expectedJson) + done() + }) + }) }) diff --git a/test/model/GetTaxProfileResponse.spec.ts b/test/model/GetTaxProfileResponse.spec.ts new file mode 100644 index 0000000..a30f064 --- /dev/null +++ b/test/model/GetTaxProfileResponse.spec.ts @@ -0,0 +1,63 @@ +/** + * Fatture in Cloud API v2 - API Reference + * Connect your software with Fatture in Cloud, the invoicing platform chosen by more than 400.000 businesses in Italy. The Fatture in Cloud API is based on REST, and makes possible to interact with the user related data prior authorization via OAuth2 protocol. For more information, please visit https://www.fattureincloud.it. + * + * Contact: info@fattureincloud.it + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import { expect } from 'chai' +import { GetTaxProfileResponse } from '../../src/models' + +const instance: GetTaxProfileResponse = { + data: { + company_type: "individual", + company_subtype: "artigiani", + profession: null, + regime: "forfettario_5", + rivalsa_name: "", + default_rivalsa: 0, + cassa_name: "", + default_cassa: 0, + default_cassa_taxable: 100, + cassa2_name: "", + default_cassa2: 0, + default_cassa2_taxable: 0, + default_withholding_tax: 0, + default_withholding_tax_taxable: 100, + default_other_withholding_tax: 0, + enasarco: false, + enasarco_type: null, + contributions_percentage: 0, + med: false, + default_vat: { + id: 66, + value: 0, + description: "Contribuenti forfettari", + notes: "Operazione non soggetta a IVA ai sensi dell'art. 1, commi 54-89, Legge n. 190\/2014 e succ. modifiche\/integrazioni", + e_invoice: true, + ei_type: "2.2", + ei_description: "Non soggetta art. 1\/54-89 L. 190\/2014 e succ. modifiche\/integrazioni", + editable: false, + is_disabled: false, + default: true + } +} +} + +// beforeEach(function () { +// }) + +describe('GetTaxProfileResponse', function () { + it('should create an instance of GetTaxProfileResponse', function () { + expect(instance).to.be.a('object') + }) + + it('should have the property data (base name: "data")', function () { + expect(instance.data).to.be.a('object') + }) +}) diff --git a/test/model/TaxProfile.spec.ts b/test/model/TaxProfile.spec.ts new file mode 100644 index 0000000..6be75cd --- /dev/null +++ b/test/model/TaxProfile.spec.ts @@ -0,0 +1,140 @@ +/** + * Fatture in Cloud API v2 - API Reference + * Connect your software with Fatture in Cloud, the invoicing platform chosen by more than 400.000 businesses in Italy. The Fatture in Cloud API is based on REST, and makes possible to interact with the user related data prior authorization via OAuth2 protocol. For more information, please visit https://www.fattureincloud.it. + * + * Contact: info@fattureincloud.it + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import { expect } from 'chai' +import { TaxProfile } from '../../src/models' + +const instance: TaxProfile = { + company_type: "individual", + company_subtype: "artigiani", + profession: "test", + regime: "forfettario_5", + rivalsa_name: "", + default_rivalsa: 0, + cassa_name: "", + default_cassa: 0, + default_cassa_taxable: 100, + cassa2_name: "", + default_cassa2: 0, + default_cassa2_taxable: 0, + default_withholding_tax: 0, + default_withholding_tax_taxable: 100, + default_other_withholding_tax: 0, + enasarco: false, + enasarco_type: "test", + contributions_percentage: 0, + med: false, + default_vat: { + id: 66, + value: 0, + description: "Contribuenti forfettari", + notes: "Operazione non soggetta a IVA ai sensi dell'art. 1, commi 54-89, Legge n. 190\/2014 e succ. modifiche\/integrazioni", + e_invoice: true, + ei_type: "2.2", + ei_description: "Non soggetta art. 1\/54-89 L. 190\/2014 e succ. modifiche\/integrazioni", + editable: false, + is_disabled: false, + default: true + } +} + +// beforeEach(function () { +// }) + +describe('TaxProfile', function () { + it('should create an instance of TaxProfile', function () { + expect(instance).to.be.a('object') + }) + + it('should have the property companyType (base name: "company_type")', function () { + expect(instance.company_type).to.be.a('string') + }) + + it('should have the property companySubtype (base name: "company_subtype")', function () { + expect(instance.company_subtype).to.be.a('string') + }) + + it('should have the property profession (base name: "profession")', function () { + expect(instance.profession).to.be.a('string') + }) + + it('should have the property regime (base name: "regime")', function () { + expect(instance.regime).to.be.a('string') + }) + + it('should have the property rivalsaName (base name: "rivalsa_name")', function () { + expect(instance.rivalsa_name).to.be.a('string') + }) + + it('should have the property defaultRivalsa (base name: "default_rivalsa")', function () { + expect(instance.default_rivalsa).to.be.a('number') + }) + + it('should have the property cassaName (base name: "cassa_name")', function () { + expect(instance.cassa_name).to.be.a('string') + }) + + it('should have the property defaultCassa (base name: "default_cassa")', function () { + expect(instance.default_cassa).to.be.a('number') + }) + + it('should have the property defaultCassaTaxable (base name: "default_cassa_taxable")', function () { + expect(instance.default_cassa_taxable).to.be.a('number') + }) + + it('should have the property cassa2Name (base name: "cassa2_name")', function () { + expect(instance.cassa2_name).to.be.a('string') + }) + + it('should have the property defaultCassa2 (base name: "default_cassa2")', function () { + expect(instance.default_cassa2).to.be.a('number') + }) + + it('should have the property defaultCassa2Taxable (base name: "default_cassa2_taxable")', function () { + expect(instance.default_cassa2_taxable).to.be.a('number') + }) + + it('should have the property defaultWithholdingTax (base name: "default_withholding_tax")', function () { + expect(instance.default_withholding_tax).to.be.a('number') + }) + + it('should have the property defaultWithholdingTaxTaxable (base name: "default_withholding_tax_taxable")', function () { + expect(instance.default_withholding_tax_taxable).to.be.a('number') + }) + + it('should have the property defaultOtherWithholdingTax (base name: "default_other_withholding_tax")', function () { + expect(instance.default_other_withholding_tax).to.be.a('number') + }) + + it('should have the property enasarco (base name: "enasarco")', function () { + expect(instance.enasarco).to.be.a('boolean') + }) + + it('should have the property enasarcoType (base name: "enasarco_type")', function () { + expect(instance.enasarco_type).to.be.a('string') + }) + + it('should have the property contributionsPercentage (base name: "contributions_percentage")', function () { + expect(instance.contributions_percentage).to.be.a('number') + }) + + it('should have the property med (base name: "med")', function () { + expect(instance.med).to.be.a('boolean') + }) + + it('should have the property defaultVat (base name: "default_vat")', function () { + expect(instance.default_vat).to.be.a('object') + }) +}) + + +