From 17dd3be4df6e25bef60c6c37c9cc273b15621bf6 Mon Sep 17 00:00:00 2001 From: samyou-softwire Date: Wed, 11 Mar 2026 17:00:55 +0000 Subject: [PATCH] CLDC-4029: Add tests for user filters displaying --- spec/features/user_spec.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/spec/features/user_spec.rb b/spec/features/user_spec.rb index 0f75a562a..e4acfbbf0 100644 --- a/spec/features/user_spec.rb +++ b/spec/features/user_spec.rb @@ -282,6 +282,12 @@ RSpec.describe "User Features" do end end end + + it "shows correct filters" do + expect(page).to have_selector("label", text: "Data provider") + expect(page).to have_selector("label", text: "Data coordinator") + expect(page).not_to have_selector("label", text: "Support") + end end end @@ -619,6 +625,20 @@ RSpec.describe "User Features" do expect(page).to have_button("Resend invite link") end end + + context "when filtering users" do + before do + allow(user).to receive(:need_two_factor_authentication?).and_return(false) + sign_in(user) + visit(users_path) + end + + it "shows correct filters" do + expect(page).to have_selector("label", text: "Data provider") + expect(page).to have_selector("label", text: "Data coordinator") + expect(page).to have_selector("label", text: "Support") + end + end end context "when the user is a customer support person" do