Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: added new testes tax profile #51

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion test/api/SettingsApi.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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 () {

// })
Expand Down Expand Up @@ -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()
})
})
})
63 changes: 63 additions & 0 deletions test/model/GetTaxProfileResponse.spec.ts
Original file line number Diff line number Diff line change
@@ -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: [email protected]
*
* 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')
})
})
140 changes: 140 additions & 0 deletions test/model/TaxProfile.spec.ts
Original file line number Diff line number Diff line change
@@ -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: [email protected]
*
* 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')
})
})