Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
leximpact-budget-ui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
leximpact
leximpact-budget-ui
Commits
980b8359
Commit
980b8359
authored
Mar 22, 2022
by
sandcha
Browse files
Options
Downloads
Patches
Plain Diff
Improve import and lint test file
parent
b78b17c4
No related branches found
No related tags found
1 merge request
!5
Désactive le PLF 2022
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/lib/api-budget.test.ts
+57
-51
57 additions, 51 deletions
src/lib/api-budget.test.ts
with
57 additions
and
51 deletions
src/lib/api-budget.test.ts
+
57
−
51
View file @
980b8359
import
type
{
JsonValue
}
from
"
@openfisca/json-model
"
;
import
{
getParameter
}
from
"
.
/parameters
"
import
type
{
JsonValue
}
from
"
@openfisca/json-model
"
import
{
getParameter
}
from
"
$lib
/parameters
"
test
(
'
compare simple parameter format in openfisca and reform
'
,
()
=>
{
test
(
"
compare simple parameter format in openfisca and reform
"
,
()
=>
{
// reform format where the parameter value is unchanged
const
reform_format
=
{
"
prelevements_sociaux.contributions_sociales.csg.activite.imposable.taux
"
:
{
start
:
"
2022-01-01
"
,
type
:
"
parameter
"
,
value
:
0.024
,
},
}
}
const
openfisca_format
=
getParameter
(
"
prelevements_sociaux.contributions_sociales.csg.activite.imposable.taux
"
)
as
unknown
as
JsonValue
const
openfisca_format
=
getParameter
(
"
prelevements_sociaux.contributions_sociales.csg.activite.imposable.taux
"
,
)
as
unknown
as
JsonValue
// this check only explicits formats differences
expect
(
openfisca_format
[
"
values
"
][
"
1993-07-01
"
][
"
value
"
]).
toBe
(
reform_format
[
"
prelevements_sociaux.contributions_sociales.csg.activite.imposable.taux
"
][
"
value
"
]
);
});
reform_format
[
"
prelevements_sociaux.contributions_sociales.csg.activite.imposable.taux
"
][
"
value
"
],
)
})
test
(
'
compare scale parameter format in openfisca and reform
'
,
()
=>
{
test
(
"
compare scale parameter format in openfisca and reform
"
,
()
=>
{
const
reform_format
=
{
"
prelevements_sociaux.contributions_sociales.csg.activite.imposable.abattement
"
:
{
...
...
@@ -46,10 +48,14 @@ test('compare scale parameter format in openfisca and reform', () => {
type
:
"
scale
"
,
},
}
const
openfisca_format
=
getParameter
(
"
prelevements_sociaux.contributions_sociales.csg.activite.imposable.abattement
"
)
const
openfisca_format
=
getParameter
(
"
prelevements_sociaux.contributions_sociales.csg.activite.imposable.abattement
"
,
)
// this check only explicits formats differences
expect
(
openfisca_format
[
"
brackets
"
][
0
][
"
rate
"
][
"
2012-01-01
"
][
"
value
"
]).
toBe
(
reform_format
[
"
prelevements_sociaux.contributions_sociales.csg.activite.imposable.abattement
"
][
"
scale
"
][
0
][
"
rate
"
][
"
value
"
]
);
});
reform_format
[
"
prelevements_sociaux.contributions_sociales.csg.activite.imposable.abattement
"
][
"
scale
"
][
0
][
"
rate
"
][
"
value
"
],
)
})
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment