Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add key shortcuts and role attributes to the filtering menu's links. (#…
…10548) * Make changes to the Filter's 'SelectAll' and 'Clear' links. * Add test cases.
- Loading branch information
Showing
4 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
handsontable/src/plugins/filters/__tests__/a11y/attributes.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
describe('a11y DOM attributes (ARIA tags)', () => { | ||
const id = 'testContainer'; | ||
|
||
beforeEach(function() { | ||
this.$container = $(`<div id="${id}"></div>`).appendTo('body'); | ||
}); | ||
|
||
afterEach(function() { | ||
if (this.$container) { | ||
destroy(); | ||
this.$container.remove(); | ||
} | ||
}); | ||
|
||
it('should assign the `role=button` to the `Select All` and `Clear` links', async() => { | ||
handsontable({ | ||
colHeaders: true, | ||
filters: true, | ||
dropdownMenu: true, | ||
}); | ||
|
||
dropdownMenu(0); | ||
|
||
expect(document.querySelector('.htUISelectAll').getAttribute('role')).toEqual('button'); | ||
expect(document.querySelector('.htUIClearAll').getAttribute('role')).toEqual('button'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters