Fix tests
parent
aa7027b329
commit
0ad2e2242b
|
@ -1,20 +1,23 @@
|
|||
import { configAutoEntrepreneur } from '@/pages/Simulateurs/configs/autoEntrepreneur'
|
||||
import { expect, it } from 'vitest'
|
||||
import autoentrepreneurConfig from '../../source/pages/Simulateurs/configs/auto-entrepreneur.yaml'
|
||||
import autoEntrepreneurSituations from './simulations-auto-entrepreneur.yaml'
|
||||
import { engine, getMissingVariables, runSimulations } from './utils'
|
||||
|
||||
it('calculate simulations-auto-entrepreneur', () => {
|
||||
runSimulations(
|
||||
autoEntrepreneurSituations,
|
||||
autoentrepreneurConfig.objectifs,
|
||||
autoentrepreneurConfig.situation
|
||||
[
|
||||
...(configAutoEntrepreneur.objectifs ?? []),
|
||||
...(configAutoEntrepreneur['objectifs cachés'] ?? []),
|
||||
],
|
||||
configAutoEntrepreneur.situation
|
||||
)
|
||||
|
||||
expect(
|
||||
getMissingVariables(
|
||||
engine
|
||||
.setSituation({
|
||||
...autoentrepreneurConfig.situation,
|
||||
...configAutoEntrepreneur.situation,
|
||||
"dirigeant . auto-entrepreneur . chiffre d'affaires": '30000 €/an',
|
||||
})
|
||||
.evaluate('dirigeant . auto-entrepreneur . revenu net . après impôt')
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { configDividendes } from '@/pages/Simulateurs/configs/dividendes'
|
||||
import { it } from 'vitest'
|
||||
import dividendesConfig from '../../source/pages/Simulateurs/configs/dividendes.yaml'
|
||||
import dividendesSituations from './simulations-dividendes.yaml'
|
||||
import { runSimulations } from './utils'
|
||||
|
||||
|
@ -7,13 +7,14 @@ it('calculate simulations-dividendes', () => {
|
|||
runSimulations(
|
||||
dividendesSituations,
|
||||
[
|
||||
...dividendesConfig.objectifs,
|
||||
...(configDividendes.objectifs ?? []),
|
||||
...(configDividendes['objectifs cachés'] ?? []),
|
||||
'bénéficiaire . dividendes . cotisations et contributions',
|
||||
'impôt . montant',
|
||||
'impôt . revenu imposable',
|
||||
'bénéficiaire . dividendes . imposables',
|
||||
"impôt . taux d'imposition",
|
||||
],
|
||||
dividendesConfig.situation
|
||||
configDividendes.situation
|
||||
)
|
||||
})
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { configIndépendant } from '@/pages/Simulateurs/configs/indépendant'
|
||||
import { DottedName } from 'modele-social'
|
||||
import { it } from 'vitest'
|
||||
import independantConfig from '../../source/pages/Simulateurs/configs/indépendant.yaml'
|
||||
import independentSituations from './simulations-indépendant.yaml'
|
||||
import { runSimulations } from './utils'
|
||||
|
||||
|
@ -16,5 +16,5 @@ it('calculate simulations-indépendant', () => {
|
|||
"entreprise . chiffre d'affaires",
|
||||
'dirigeant . indépendant . cotisations et contributions . début activité',
|
||||
] as DottedName[]
|
||||
runSimulations(independentSituations, objectifs, independantConfig.situation)
|
||||
runSimulations(independentSituations, objectifs, configIndépendant.situation)
|
||||
})
|
||||
|
|
|
@ -1,14 +1,17 @@
|
|||
import { configProfessionLibérale } from '@/pages/Simulateurs/configs/professionLibérale'
|
||||
import { it } from 'vitest'
|
||||
import professionLibéraleConfig from '../../source/pages/Simulateurs/configs/profession-libérale.yaml'
|
||||
import professionsLibéralesSituations from './simulations-professions-libérales.yaml'
|
||||
import { runSimulations } from './utils'
|
||||
|
||||
it('calculate simulations-professions-libérales', () => {
|
||||
runSimulations(
|
||||
professionsLibéralesSituations,
|
||||
professionLibéraleConfig.objectifs,
|
||||
[
|
||||
...(configProfessionLibérale.objectifs ?? []),
|
||||
...(configProfessionLibérale['objectifs cachés'] ?? []),
|
||||
],
|
||||
{
|
||||
...professionLibéraleConfig.situation,
|
||||
...configProfessionLibérale.situation,
|
||||
'entreprise . activité . nature . libérale . réglementée': 'oui',
|
||||
}
|
||||
)
|
||||
|
|
|
@ -1,20 +1,23 @@
|
|||
import { configSalarié } from '@/pages/Simulateurs/configs/salarié'
|
||||
import { expect, it } from 'vitest'
|
||||
import employeeConfig from '../../source/pages/Simulateurs/configs/salarié.yaml'
|
||||
import employeeSituations from './simulations-salarié.yaml'
|
||||
import { engine, getMissingVariables, runSimulations } from './utils'
|
||||
|
||||
it('calculate simulations-salarié', () => {
|
||||
runSimulations(
|
||||
employeeSituations,
|
||||
employeeConfig.objectifs,
|
||||
employeeConfig.situation
|
||||
[
|
||||
...(configSalarié.objectifs ?? []),
|
||||
...(configSalarié['objectifs cachés'] ?? []),
|
||||
],
|
||||
configSalarié.situation
|
||||
)
|
||||
|
||||
expect(
|
||||
getMissingVariables(
|
||||
engine
|
||||
.setSituation({
|
||||
...employeeConfig.situation,
|
||||
...configSalarié.situation,
|
||||
'salarié . contrat . salaire brut': '3000 €/mois',
|
||||
})
|
||||
.evaluate('salarié . rémunération . net . payé après impôt')
|
||||
|
|
Loading…
Reference in New Issue