From 722d2c29af743b89b8aa9df773d45e3a9e5faa9d Mon Sep 17 00:00:00 2001 From: Sam Seed Date: Fri, 27 Oct 2023 13:36:55 +0100 Subject: [PATCH] CLDC-2862: test header bar links hidden in maintenance mode --- spec/features/user_spec.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/spec/features/user_spec.rb b/spec/features/user_spec.rb index 39327a75a..ca4e01ac6 100644 --- a/spec/features/user_spec.rb +++ b/spec/features/user_spec.rb @@ -139,6 +139,12 @@ RSpec.describe "User Features" do visit("/users/#{user.id}") expect(page).to have_content("Sign in to your account to submit CORE data") end + + it "does not show 'Sign in' link if maintenance mode is enabled" do + allow(FeatureToggle).to receive(:maintenance_mode_enabled?).and_return(true) + visit("/lettings-logs") + expect(page).not_to have_link("Sign in") + end end context "when the user is trying to log in with incorrect credentials" do @@ -324,6 +330,13 @@ RSpec.describe "User Features" do expect(page).to have_selector('[data-qa="change-data-protection-officer"]') expect(page).to have_selector('[data-qa="change-key-contact"]') end + + it "does not show 'Your account' or 'Sign out' links if maintenance mode is enabled" do + allow(FeatureToggle).to receive(:maintenance_mode_enabled?).and_return(true) + visit("/lettings-logs") + expect(page).not_to have_link("Your account") + expect(page).not_to have_link("Sign out") + end end context "when adding a new user" do