Browse Source

CLDC-4114: Update tests

CLDC-4114-update-no-dsa-signing-warning
Samuel Young 2 days ago
parent
commit
a4a6f5cd72
  1. 29
      spec/components/data_protection_confirmation_banner_component_spec.rb

29
spec/components/data_protection_confirmation_banner_component_spec.rb

@ -23,13 +23,18 @@ RSpec.describe DataProtectionConfirmationBannerComponent, type: :component do
organisation.users.where(is_dpo: true).destroy_all organisation.users.where(is_dpo: true).destroy_all
end end
it "displays the banner" do context "when org does not have a signed data sharing agreement" do
expect(component.display_banner?).to eq(true) let(:organisation) { create(:organisation, :without_dpc) }
expect(render).to have_link( let(:user) { create(:user, organisation:, with_dsa: false) }
"Contact helpdesk to assign a data protection officer",
href: "https://mhclgdigital.atlassian.net/servicedesk/customer/portal/6/group/11", it "displays the banner" do
) expect(component.display_banner?).to eq(true)
expect(render).to have_selector("p", text: "To create logs your organisation must state a data protection officer. They must sign the Data Sharing Agreement.") expect(render).to have_link(
"Contact helpdesk to assign a data protection officer",
href: "https://mhclgdigital.atlassian.net/servicedesk/customer/portal/6/group/11",
)
expect(render).to have_selector("p", text: "To create logs your organisation must state a data protection officer. They must sign the Data Sharing Agreement.")
end
end end
end end
@ -127,13 +132,9 @@ RSpec.describe DataProtectionConfirmationBannerComponent, type: :component do
organisation.users.where(is_dpo: true).destroy_all organisation.users.where(is_dpo: true).destroy_all
end end
it "displays the banner" do it "doesn't display the banner" do
expect(component.display_banner?).to eq(true) expect(component.display_banner?).to eq(false)
expect(render).to have_link( expect(render.content).to be_empty
"Contact helpdesk to assign a data protection officer",
href: "https://mhclgdigital.atlassian.net/servicedesk/customer/portal/6/group/11",
)
expect(render).to have_selector("p", text: "To create logs your organisation must state a data protection officer. They must sign the Data Sharing Agreement.")
end end
end end

Loading…
Cancel
Save