mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 10:57:04 +08:00
DEV: fix flakey spec in sidebar (#29254)
Technically we don't show the edit custom section button on mobile, but the button is present so I just fixed it so the finder works on mobile. We should probably remove this test or find a way to make the button visible on mobile. Also used `mobile: true` instead of manual url.
This commit is contained in:
parent
af6788fd33
commit
54935219d7
|
@ -251,7 +251,7 @@ describe "Custom sidebar sections", type: :system do
|
|||
)
|
||||
end
|
||||
|
||||
it "does not allow to drag on mobile" do
|
||||
it "does not allow to drag on mobile", mobile: true do
|
||||
sidebar_section = Fabricate(:sidebar_section, title: "My section", user: user)
|
||||
|
||||
Fabricate(:sidebar_url, name: "Sidebar Tags", value: "/tags").tap do |sidebar_url|
|
||||
|
@ -264,7 +264,7 @@ describe "Custom sidebar sections", type: :system do
|
|||
|
||||
sign_in user
|
||||
|
||||
visit("/latest?mobile_view=1")
|
||||
visit("/latest")
|
||||
|
||||
sidebar.open_on_mobile
|
||||
sidebar.edit_custom_section("My section")
|
||||
|
|
|
@ -190,11 +190,17 @@ module PageObjects
|
|||
def edit_custom_section(name)
|
||||
name = name.parameterize
|
||||
|
||||
find(".sidebar-section[data-section-name='#{name}']").hover
|
||||
|
||||
find(
|
||||
".sidebar-section[data-section-name='#{name}'] button.sidebar-section-header-button",
|
||||
).click
|
||||
if page.has_css?("html.mobile-view", wait: 0)
|
||||
find(
|
||||
".sidebar-section[data-section-name='#{name}'] button.sidebar-section-header-button",
|
||||
visible: false,
|
||||
).click
|
||||
else
|
||||
find(".sidebar-section[data-section-name='#{name}']").hover
|
||||
find(
|
||||
".sidebar-section[data-section-name='#{name}'] button.sidebar-section-header-button",
|
||||
).click
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
|
Loading…
Reference in New Issue
Block a user