✅ Ajout d'un test d'intégration pour le temps partiel au smic
Ainsi que d'un test unitaire pour les références dans la situationpull/1158/head
parent
973f12ab46
commit
6fa30e505c
|
@ -143,4 +143,21 @@ describe('Simulateur salarié', () => {
|
|||
cy.contains('Voir ma situation').click()
|
||||
cy.contains('Steenvoorde (59114)')
|
||||
})
|
||||
|
||||
it.only('should permit selecting the smic before part-time contrat', function() {
|
||||
cy.get('input[name$="brut de base"').click()
|
||||
cy.get('button')
|
||||
.contains('SMIC')
|
||||
.click()
|
||||
cy.contains('Voir ma situation').click()
|
||||
cy.contains('Temps partiel').click()
|
||||
cy.get('input[value="oui"]')
|
||||
.parent()
|
||||
.click()
|
||||
cy.get('input[name$="brut de base"').should($input => {
|
||||
expect(+$input.val().replace(/[\s,.]/g, ''))
|
||||
.to.be.above(1300)
|
||||
.and.to.be.below(1500)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
@ -72,4 +72,20 @@ impôt sur le revenu à payer:
|
|||
let value = engine.evaluate('douche . impact')
|
||||
expect(value.nodeValue).to.be.within(20, 21)
|
||||
})
|
||||
|
||||
it('should let the user reference rules in the situation', function() {
|
||||
let rules = `
|
||||
referenced in situation:
|
||||
formule: 200
|
||||
overwrited in situation:
|
||||
formule: 100
|
||||
result:
|
||||
formule: overwrited in situation + 22
|
||||
`
|
||||
let engine = new Engine(rules)
|
||||
engine.setSituation({
|
||||
'overwrited in situation': 'referenced in situation'
|
||||
})
|
||||
expect(engine.evaluate('result').nodeValue).to.equal(222)
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue