File tree Expand file tree Collapse file tree
test/components/primer/open_project Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -282,4 +282,24 @@ def test_renders_additional_details
282282 assert_selector ( ".DangerDialog-additionalDetails" , text : "Additional important information." )
283283 end
284284 end
285+
286+ def test_renders_live_region_for_confirmation_checkbox
287+ render_inline ( Primer ::OpenProject ::DangerDialog . new (
288+ title : "Danger confirmation action" ,
289+ confirmation_live_message_checked : "Checkbox checked — you can proceed." ,
290+ confirmation_live_message_unchecked : "Please check the confirmation box to continue."
291+ ) ) do |dialog |
292+ dialog . with_confirmation_message do |message |
293+ message . with_heading ( tag : :h2 ) { "Danger" }
294+ end
295+ dialog . with_confirmation_check_box { "I confirm this deletion" }
296+ end
297+
298+ # Check that the live region exists and is sr-only
299+ assert_selector ( "div.sr-only[data-target='danger-dialog-form-helper.liveRegion']" )
300+
301+ live_region = page . find_css ( "div.sr-only[data-target='danger-dialog-form-helper.liveRegion']" ) . first
302+ assert_equal "assertive" , live_region . attributes [ "aria-live" ] . value
303+ assert_equal "true" , live_region . attributes [ "aria-atomic" ] . value
304+ end
285305end
You can’t perform that action at this time.
0 commit comments