Skip to content

Commit

Permalink
DEV: add glimmer header context for system spec (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
tyb-talks authored Apr 2, 2024
1 parent 9edef0c commit 0a837d7
Showing 1 changed file with 57 additions and 22 deletions.
79 changes: 57 additions & 22 deletions spec/system/viewing_custom_header_links_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,62 @@
fab!(:theme) { upload_theme_component }
let!(:custom_header_link) { PageObjects::Components::CustomHeaderLink.new }

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",
)
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
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

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

0 comments on commit 0a837d7

Please sign in to comment.