diff --git a/web/src/components/SftCorrectionArea.test.ts b/web/src/components/SftCorrectionArea.test.ts index 5c72d6a..8ecc409 100644 --- a/web/src/components/SftCorrectionArea.test.ts +++ b/web/src/components/SftCorrectionArea.test.ts @@ -59,4 +59,10 @@ describe('SftCorrectionArea', () => { await w.find('textarea').trigger('keydown', { key: 'Enter', ctrlKey: true }) expect(w.emitted('submit')).toBeFalsy() }) + + it('omits aria-describedby when describedBy prop is not provided', () => { + const w = mount(SftCorrectionArea) + const textarea = w.find('textarea') + expect(textarea.attributes('aria-describedby')).toBeUndefined() + }) }) diff --git a/web/src/components/SftCorrectionArea.vue b/web/src/components/SftCorrectionArea.vue index b9279f5..44dfd2e 100644 --- a/web/src/components/SftCorrectionArea.vue +++ b/web/src/components/SftCorrectionArea.vue @@ -10,7 +10,7 @@ class="correction-textarea" aria-label="Write corrected response" aria-required="true" - :aria-describedby="describedBy" + :aria-describedby="describedBy || undefined" placeholder="Write the response this model should have given..." rows="4" @keydown.escape="$emit('cancel')"