2022-05-24 17:00:18 +00:00
|
|
|
import rules, { DottedName } from 'modele-social'
|
|
|
|
import Engine from 'publicodes'
|
|
|
|
import { beforeAll, describe, expect, it } from 'vitest'
|
|
|
|
|
|
|
|
describe('modele-social', function () {
|
|
|
|
let engine: Engine<DottedName>
|
|
|
|
beforeAll(() => {
|
|
|
|
engine = new Engine(rules)
|
|
|
|
})
|
2024-02-23 10:31:44 +00:00
|
|
|
it("ne change pas le montant de l'IR ni des cotisations lorsqu'on verse un forfait mobilités durables", function () {
|
2022-05-24 17:00:18 +00:00
|
|
|
expect(
|
|
|
|
engine
|
|
|
|
.setSituation({ 'salarié . contrat . salaire brut': 2300 })
|
|
|
|
.evaluate('impôt . montant').nodeValue
|
|
|
|
).toEqual(
|
|
|
|
engine
|
|
|
|
.setSituation(
|
|
|
|
{
|
|
|
|
'salarié . rémunération . frais professionnels . trajets domicile travail . forfait mobilités durables . montant': 500,
|
|
|
|
},
|
|
|
|
{ keepPreviousSituation: true }
|
|
|
|
)
|
|
|
|
.evaluate('impôt . montant').nodeValue
|
|
|
|
)
|
|
|
|
})
|
|
|
|
})
|