Skip to content

Commit 9409ef6

Browse files
authored
test(FileUpload): add aria-label to axe test case (#5509)
1 parent f99ec46 commit 9409ef6

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

test/components/FileUpload.spec.ts

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -98,23 +98,13 @@ describe('FileUpload', () => {
9898
label: 'Upload files',
9999
description: 'Select files to upload',
100100
required: true
101+
},
102+
attrs: {
103+
'aria-label': 'Choose a file'
101104
}
102105
})
103106

104-
expect(await axe(wrapper.element, {
105-
rules: {
106-
// "Form elements must have labels (label)"
107-
// Fix any of the following:
108-
// Element does not have an implicit (wrapped) <label>
109-
// Element does not have an explicit <label>
110-
// aria-label attribute does not exist or is empty
111-
// aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty
112-
// Element has no title attribute
113-
// Element has no placeholder attribute
114-
// Element's default semantics were not overridden with role="none" or role="presentation"
115-
label: { enabled: false }
116-
}
117-
})).toHaveNoViolations()
107+
expect(await axe(wrapper.element)).toHaveNoViolations()
118108
})
119109

120110
describe('emits', () => {

0 commit comments

Comments
 (0)