feat(ui) : prop required + aria-required + astérisque sur Select/SelectCheckbox/Upload/RichText

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-03 11:32:10 +02:00
parent 03fe458248
commit 167cc43870
8 changed files with 80 additions and 4 deletions
@@ -19,6 +19,7 @@ type InputRichTextProps = {
groupClass?: string
labelClass?: string
editorClass?: string
required?: boolean
}
const InputRichTextForTest = InputRichText as DefineComponent<InputRichTextProps>
@@ -162,4 +163,16 @@ describe('MalioInputRichText', () => {
expect(html).toContain('Mon titre')
expect(html).toContain('Un paragraphe.')
})
it('affiche l\'astérisque quand required est vrai', async () => {
const wrapper = await mountComponent({label: 'Champ', required: true})
expect(wrapper.find('[data-test="required-mark"]').exists()).toBe(true)
})
it('n\'affiche pas l\'astérisque par défaut', async () => {
const wrapper = await mountComponent({label: 'Champ'})
expect(wrapper.find('[data-test="required-mark"]').exists()).toBe(false)
})
})