Skip to content
Snippets Groups Projects
Commit 2ae22388 authored by sandcha's avatar sandcha
Browse files

Move amendement examples to test file

parent 980b8359
No related branches found
No related tags found
1 merge request!5Désactive le PLF 2022
......@@ -59,3 +59,70 @@ test("compare scale parameter format in openfisca and reform", () => {
]["scale"][0]["rate"]["value"],
)
})
test("calculateBudget", () => {
const API_ENDPOINT_URL =
"https://api-simu-etat-integ.leximpact.dev/state_simulation"
const YEAR_BASE = "2022"
const YEAR_PLF = ""
const UNKNOWN_USER = "INVALID_TOKEN"
const AMENDEMENT_EXAMPLE = {
// AmendementRequest
"prelevements_sociaux.contributions_sociales.csg.activite.imposable.taux": 0.064,
"prelevements_sociaux.contributions_sociales.csg.activite.deductible.taux": 0.028,
"prelevements_sociaux.contributions_sociales.csg.activite.deductible.abattement":
{
scale: [
{ rate: { value: 0.5 }, threshold: { value: 0 } },
{ rate: { value: 0 }, threshold: { value: 4 } },
],
start: "2021-01-01",
type: "scale",
},
}
const AMENDEMENT_EXAMPLE_2 = {
// Writable<Reform>
"prelevements_sociaux.contributions_sociales.csg.activite.deductible.abattement":
{
scale: [
{
rate: {
value: 0.03,
},
threshold: {
value: 0,
},
},
{
rate: {
value: 0,
},
threshold: {
value: 4,
},
},
],
start: "2021-01-01",
type: "scale",
},
"prelevements_sociaux.contributions_sociales.csg.activite.imposable.taux": {
start: "2021-01-01",
type: "parameter",
value: 0.04,
},
subscribe: undefined,
set: undefined,
update: undefined,
}
//calculateBudget(
// API_ENDPOINT_URL,
// UNKNOWN_USER,
// YEAR_BASE,
// YEAR_PLF,
// AMENDEMENT_EXAMPLE_2,
// API_OUTPUT_VARIABLES,
// API_QUANTILES_BASE_VARIABLES,
// API_QUANTILES_COMPARE_VARIABLES,
//)
})
......@@ -76,59 +76,6 @@ export type ApiResponse = {
error?: string
}
// EXAMPLES
// TODO move examples to test files
const AMENDEMENT_EXAMPLE = {
// AmendementRequest
"prelevements_sociaux.contributions_sociales.csg.activite.imposable.taux": 0.064,
"prelevements_sociaux.contributions_sociales.csg.activite.deductible.taux": 0.028,
"prelevements_sociaux.contributions_sociales.csg.activite.deductible.abattement":
{
scale: [
{ rate: { value: 0.5 }, threshold: { value: 0 } },
{ rate: { value: 0 }, threshold: { value: 4 } },
],
start: "2021-01-01",
type: "scale",
},
}
const AMENDEMENT_EXAMPLE_2 = {
// Writable<Reform>
"prelevements_sociaux.contributions_sociales.csg.activite.deductible.abattement":
{
scale: [
{
rate: {
value: 0.03,
},
threshold: {
value: 0,
},
},
{
rate: {
value: 0,
},
threshold: {
value: 4,
},
},
],
start: "2021-01-01",
type: "scale",
},
"prelevements_sociaux.contributions_sociales.csg.activite.imposable.taux": {
start: "2021-01-01",
type: "parameter",
value: 0.04,
},
subscribe: undefined,
set: undefined,
update: undefined,
}
const RESPONSE_EXAMPLE: ApiResponse = {
result: {
base: {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment