DEV: Remove old header widget code (#66)

This commit is contained in:
Sérgio Saquetim 2024-08-19 16:35:56 -03:00 committed by GitHub
parent 843a579e86
commit ec751e4631
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 18 additions and 62 deletions

View File

@ -40,71 +40,27 @@ RSpec.describe "Viewing Custom Header Links", system: true do
theme.save! theme.save!
end end
context "when glimmer headers are enabled" do it "should display the custom header links" do
before do visit("/")
if SiteSetting.respond_to?(:experimental_glimmer_header_groups)
SiteSetting.experimental_glimmer_header_groups = Group::AUTO_GROUPS[:everyone]
else
SiteSetting.glimmer_header_mode = "enabled"
end
end
it "should display the custom header links" do expect(custom_header_link).to be_visible
visit("/")
expect(custom_header_link).to be_visible expect(custom_header_link).to have_custom_header_link(
"External link",
href: "https://meta.discourse.org",
title: "This link will open in a new tab",
)
expect(custom_header_link).to have_custom_header_link( expect(custom_header_link).to have_custom_header_link(
"External link", "Most Liked",
href: "https://meta.discourse.org", href: "/latest/?order=op_likes",
title: "This link will open in a new tab", title: "Posts with the most amount of likes",
) )
expect(custom_header_link).to have_custom_header_link( expect(custom_header_link).to have_custom_header_link(
"Most Liked", "Privacy",
href: "/latest/?order=op_likes", href: "/privacy",
title: "Posts with the most amount of likes", title: "Our Privacy Policy",
) )
expect(custom_header_link).to have_custom_header_link(
"Privacy",
href: "/privacy",
title: "Our Privacy Policy",
)
end
end
context "when glimmer headers are disabled" do
before do
if SiteSetting.respond_to?(:experimental_glimmer_header_groups)
SiteSetting.experimental_glimmer_header_groups = nil
else
SiteSetting.glimmer_header_mode = "disabled"
end
end
it "should display the custom header links" do
visit("/")
expect(custom_header_link).to be_visible
expect(custom_header_link).to have_custom_header_link(
"External link",
href: "https://meta.discourse.org",
title: "This link will open in a new tab",
)
expect(custom_header_link).to have_custom_header_link(
"Most Liked",
href: "/latest/?order=op_likes",
title: "Posts with the most amount of likes",
)
expect(custom_header_link).to have_custom_header_link(
"Privacy",
href: "/privacy",
title: "Our Privacy Policy",
)
end
end end
end end