mirror of
https://github.com/discourse/discourse-custom-header-links.git
synced 2025-05-12 11:49:15 +00:00
DEV: add glimmer header context for system spec
This commit is contained in:
parent
9edef0c5f7
commit
8e23f11885
@ -6,6 +6,12 @@ RSpec.describe "Viewing Custom Header Links", system: true do
|
|||||||
fab!(:theme) { upload_theme_component }
|
fab!(:theme) { upload_theme_component }
|
||||||
let!(:custom_header_link) { PageObjects::Components::CustomHeaderLink.new }
|
let!(:custom_header_link) { PageObjects::Components::CustomHeaderLink.new }
|
||||||
|
|
||||||
|
context "when glimmer headers are enabled" do
|
||||||
|
before do
|
||||||
|
SiteSetting.experimental_glimmer_header_groups =
|
||||||
|
Group::AUTO_GROUPS[:everyone]
|
||||||
|
end
|
||||||
|
|
||||||
it "should display the custom header links" do
|
it "should display the custom header links" do
|
||||||
visit("/")
|
visit("/")
|
||||||
|
|
||||||
@ -14,19 +20,48 @@ RSpec.describe "Viewing Custom Header Links", system: true do
|
|||||||
expect(custom_header_link).to have_custom_header_link(
|
expect(custom_header_link).to have_custom_header_link(
|
||||||
"External link",
|
"External link",
|
||||||
href: "https://meta.discourse.org",
|
href: "https://meta.discourse.org",
|
||||||
title: "this link will open in a new tab",
|
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(
|
||||||
"Most Liked",
|
"Most Liked",
|
||||||
href: "/latest/?order=op_likes",
|
href: "/latest/?order=op_likes",
|
||||||
title: "Posts with the most amount of likes",
|
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(
|
||||||
"Privacy",
|
"Privacy",
|
||||||
href: "/privacy",
|
href: "/privacy",
|
||||||
title: "Our Privacy Policy",
|
title: "Our Privacy Policy"
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context "when glimmer headers are disabled" do
|
||||||
|
before { SiteSetting.experimental_glimmer_header_groups = nil }
|
||||||
|
|
||||||
|
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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user