DEV: Unskip flaky editing sidebar nav menu categories on mobile test (#24412)

Why this change?

The test became flaky due to d208396c5c.
In that commit, we introduced `page.has_no_css?("div.menu-panel.animating")` to `PageObjects::Components::NavigationMenu::Sidebar#open_on_mobile` but
it did not work as intended because `page.has_no_css?("div.menu-panel.animating")` can return `true` immediately as the `animating` class has not been added
to the element.

What does this change do?

Switch to the `wait_for_animation` system helper to ensure that all
animations have ended on the element.
This commit is contained in:
Alan Guo Xiang Tan 2023-11-17 06:37:20 +08:00 committed by GitHub
parent cdcf53573d
commit c2295b9d5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -24,7 +24,7 @@ RSpec.describe "Editing sidebar categories navigation", type: :system do
before { sign_in(user) }
shared_examples "a user can edit the sidebar categories navigation" do |mobile|
xit "allows a user to edit the sidebar categories navigation", mobile: mobile do
it "allows a user to edit the sidebar categories navigation", mobile: mobile do
visit "/latest"
sidebar.open_on_mobile if mobile

View File

@ -6,7 +6,7 @@ module PageObjects
class Sidebar < Base
def open_on_mobile
click_button("toggle-hamburger-menu")
page.has_no_css?("div.menu-panel.animating")
wait_for_animation(find("div.menu-panel"))
end
def visible?