Skip to content

Commit

Permalink
fix(UsaRange): remove redundant ARIA attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickcate committed Dec 17, 2023
1 parent b38a2c4 commit f1650d6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
20 changes: 7 additions & 13 deletions src/components/UsaRange/UsaRange.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,13 @@ describe('UsaRange', () => {
cy.get('div.usa-form-group').should('not.have.attr', 'name')
cy.get('label.usa-label').should('have.attr', 'for')

cy.get('input.usa-range').as('range').should('have.attr', 'id')
cy.get('@range')
.should('have.attr', 'name')
.and('contain', 'test-dropdown-name')
cy.get('@range').should('have.attr', 'type').and('contain', 'range')
cy.get('@range').should('have.attr', 'role').and('contain', 'slider')
cy.get('@range').should('have.attr', 'min').and('contain', 0)
cy.get('@range').should('have.attr', 'aria-valuemin').and('contain', 0)
cy.get('@range').should('have.attr', 'max').and('contain', 100)
cy.get('@range').should('have.attr', 'aria-valuemax').and('contain', 100)
cy.get('@range').should('have.attr', 'aria-valuenow').and('contain', '')

cy.get('@range').should('have.attr', 'aria-describedby')
cy.get('input.usa-range').should('have.attr', 'id')
cy.get('input.usa-range')
.should('have.attr', 'name', 'test-dropdown-name')
.and('have.attr', 'type', 'range')
.and('have.attr', 'min', 0)
.and('have.attr', 'max', 100)
.and('have.attr', 'aria-describedby')
})

it('displays `label`, `hint`, and `error-message` slot content', () => {
Expand Down
4 changes: 0 additions & 4 deletions src/components/UsaRange/UsaRange.vue
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,8 @@ const ariaDescribedby = computed(() => {
class="usa-range"
:class="classes"
type="range"
role="slider"
:min="min"
:max="max"
:aria-valuemin="min"
:aria-valuemax="max"
:aria-valuenow="rangeValue"
:required="required"
:aria-describedby="ariaDescribedby"
/>
Expand Down

0 comments on commit f1650d6

Please sign in to comment.