-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix accessibility bug of missing accessible name on Dialog (#2210)
- Loading branch information
Showing
4 changed files
with
34 additions
and
2 deletions.
There are no files selected for viewing
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,7 @@ | ||
--- | ||
"@primer/view-components": minor | ||
--- | ||
|
||
Fix accessibility bug of missing accessible name on `Primer::Alpha::Dialog` | ||
|
||
<!-- Changed components: Primer::Alpha::Dialog --> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# frozen_string_literal: true | ||
|
||
require "system/test_case" | ||
|
||
module Alpha | ||
class IntegrationDialogTest < System::TestCase | ||
def test_modal_has_accessible_name | ||
visit_preview(:default) | ||
|
||
click_button("Show Dialog") | ||
|
||
assert_selector("modal-dialog[aria-labelledby]") | ||
assert_equal(find("modal-dialog")["aria-labelledby"], find("h1")["id"]) | ||
end | ||
|
||
def test_focuses_close_button | ||
visit_preview(:default) | ||
|
||
click_button("Show Dialog") | ||
|
||
assert_equal page.evaluate_script("document.activeElement")["aria-label"], "Close" | ||
end | ||
end | ||
end |