Skip to content

Commit

Permalink
Additional test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
camertron committed Feb 12, 2025
1 parent 10f44d2 commit 54294bc
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions test/system/alpha/action_bar_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ def test_focus_set_within_overflow_menu

# We want to ensure that we're within the ActionMenu assert_selector("action-bar") do
keyboard.type(:enter)
assert_equal page.evaluate_script("document.activeElement.classList.contains('ActionListContent')"), true

assert_selector ".ActionListContent" do |content|
page.evaluate_script("document.activeElement === arguments[0]", content)
end
end

def test_escape_in_overflow_menu_sets_focus_back
Expand All @@ -58,7 +61,9 @@ def test_escape_in_overflow_menu_sets_focus_back
assert_equal page.evaluate_script("!!document.activeElement.closest('action-menu')"), true

keyboard.type(:enter)
assert_equal page.evaluate_script("document.activeElement.classList.contains('ActionListContent')"), true
assert_selector ".ActionListContent" do |content|
page.evaluate_script("document.activeElement === arguments[0]", content)
end

keyboard.type(:escape)

Expand All @@ -75,7 +80,10 @@ def test_click_outside_of_menu_sets_tabindex_back
keyboard.type(:tab, :left)

keyboard.type(:enter)
assert_equal page.evaluate_script("document.activeElement.classList.contains('ActionListContent')"), true

assert_selector ".ActionListContent" do |content|
page.evaluate_script("document.activeElement === arguments[0]", content)
end

mouse.click(x: 0, y: 0)
keyboard.type(:tab)
Expand Down

0 comments on commit 54294bc

Please sign in to comment.