From 6b1e11bd6f0b4931ebcee35eee96628dcc663d6e Mon Sep 17 00:00:00 2001 From: tristan Date: Wed, 3 Jun 2026 12:12:09 +0200 Subject: [PATCH] =?UTF-8?q?test(ui)=20:=20v=C3=A9rifie=20aria-required=20s?= =?UTF-8?q?ur=20Select/SelectCheckbox/RichText?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.8 (1M context) --- app/components/malio/input/InputRichText.test.ts | 12 ++++++++++++ app/components/malio/select/Select.test.ts | 16 ++++++++++++++++ .../malio/select/SelectCheckbox.test.ts | 16 ++++++++++++++++ 3 files changed, 44 insertions(+) diff --git a/app/components/malio/input/InputRichText.test.ts b/app/components/malio/input/InputRichText.test.ts index 9bb8321..8b7db86 100644 --- a/app/components/malio/input/InputRichText.test.ts +++ b/app/components/malio/input/InputRichText.test.ts @@ -156,6 +156,18 @@ describe('MalioInputRichText', () => { expect(editorContent.attributes('aria-describedby')).toBe('rt-aria-describedby') }) + it('expose aria-required quand required est vrai', async () => { + const wrapper = await mountComponent({required: true}) + + expect(wrapper.find('[aria-required="true"]').exists()).toBe(true) + }) + + it('n\'expose pas aria-required par défaut', async () => { + const wrapper = await mountComponent() + + expect(wrapper.find('[aria-required="true"]').exists()).toBe(false) + }) + it('renders initial markdown content visually', async () => { const wrapper = await mountComponent({modelValue: '## Mon titre\n\nUn paragraphe.'}) diff --git a/app/components/malio/select/Select.test.ts b/app/components/malio/select/Select.test.ts index cce6cdc..e53bb5e 100644 --- a/app/components/malio/select/Select.test.ts +++ b/app/components/malio/select/Select.test.ts @@ -277,6 +277,22 @@ describe('MalioSelect', () => { expect(wrapper.find('[data-test="required-mark"]').exists()).toBe(false) }) + it('expose aria-required quand required est vrai', () => { + const wrapper = mount(SelectForTest, { + props: {modelValue: null, options, required: true}, + }) + + expect(wrapper.find('[aria-required="true"]').exists()).toBe(true) + }) + + it('n\'expose pas aria-required par défaut', () => { + const wrapper = mount(SelectForTest, { + props: {modelValue: null, options}, + }) + + expect(wrapper.find('[aria-required="true"]').exists()).toBe(false) + }) + it('keeps the bottom border allocation when open downward (transparent, not zero)', async () => { const wrapper = mount(SelectForTest, { props: {modelValue: null, options}, diff --git a/app/components/malio/select/SelectCheckbox.test.ts b/app/components/malio/select/SelectCheckbox.test.ts index d7ff21f..1e1da6a 100644 --- a/app/components/malio/select/SelectCheckbox.test.ts +++ b/app/components/malio/select/SelectCheckbox.test.ts @@ -252,6 +252,22 @@ describe('MalioSelectCheckbox', () => { expect(wrapper.find('[data-test="required-mark"]').exists()).toBe(false) }) + it('expose aria-required quand required est vrai', () => { + const wrapper = mount(SelectCheckboxForTest, { + props: {modelValue: [], options, required: true}, + }) + + expect(wrapper.find('[aria-required="true"]').exists()).toBe(true) + }) + + it('n\'expose pas aria-required par défaut', () => { + const wrapper = mount(SelectCheckboxForTest, { + props: {modelValue: [], options}, + }) + + expect(wrapper.find('[aria-required="true"]').exists()).toBe(false) + }) + it('keeps the bottom border allocation when open downward (transparent, not zero)', async () => { const wrapper = mount(SelectCheckboxForTest, { props: {modelValue: [], options},