test: add test for #2863

pull/2901/head
Johan Girod 2024-02-16 16:19:07 +01:00
parent 2b11c25e9b
commit ecd53e3a5d
4 changed files with 31 additions and 13 deletions

View File

@ -0,0 +1,25 @@
import { checkA11Y, fr } from '../../support/utils'
describe('Simulateur indépendant', { testIsolation: false }, function () {
if (!fr) {
return
}
const inputSelector = 'div[id="simulator-legend"] input[inputmode="numeric"]'
before(function () {
return cy.visit('/simulateurs/indépendant')
})
it('should not display info about cotisations forfaitaires début activité by default', function () {
cy.get(inputSelector).first().type('{selectall}50000')
cy.contains(
'Comment fonctionne la régularisation des cotisations provisionnelles'
)
cy.contains('Montant des cotisations forfaitaires').should('not.exist')
})
it('should be RGAA compliant', function () {
checkA11Y()
})
})

View File

@ -7,14 +7,7 @@ type ViolationType = {
export const checkA11Y = () => {
cy.injectAxe()
cy.configureAxe({
rules: [
{
id: 'color-contrast',
enabled: false,
},
],
})
cy.configureAxe({})
cy.checkA11y(
null,
null,

View File

@ -16,10 +16,11 @@ export function WhenApplicable({
const defaultEngine = useEngine()
const engineValue = engine ?? defaultEngine
if (
engineValue.evaluate({ 'est applicable': dottedName }).nodeValue !== true
) {
const applicable = engineValue.evaluate({
'est applicable': dottedName,
}).nodeValue
console.log(dottedName, applicable)
if (applicable !== true) {
return null
}

View File

@ -131,7 +131,6 @@ export default function RuleInput<Names extends string = DottedName>({
['radio', 'card', 'toggle', 'select'].includes(meta.affichage)
? (meta.affichage as 'radio' | 'card' | 'toggle' | 'select')
: 'radio')
console.log(value, missing, dottedName)
return (
<>