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
end
it "displays the banner" do
expect(component.display_banner?).to eq(true)
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.")
context "when org does not have a signed data sharing agreement" do
let(:organisation) { create(:organisation, :without_dpc) }
let(:user) { create(:user, organisation:, with_dsa: false) }
it "displays the banner" do
expect(component.display_banner?).to eq(true)
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
@ -127,13 +132,9 @@ RSpec.describe DataProtectionConfirmationBannerComponent, type: :component do
organisation.users.where(is_dpo: true).destroy_all
end
it "displays the banner" do
expect(component.display_banner?).to eq(true)
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.")
it "doesn't display the banner" do
expect(component.display_banner?).to eq(false)
expect(render.content).to be_empty
end
end

Loading…
Cancel
Save