expect(render).tohave_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
expect(render).tohave_selector("p",text:"To create logs your organisation must state a data protection officer. They must sign the Data Sharing Agreement.")
end
end
context"when org does have a signed data sharing agreement"do
it"does not display banner"do
expect(component.display_banner?).toeq(false)
expect(render.content).tobe_empty
end
end
end
@ -81,7 +93,7 @@ RSpec.describe DataProtectionConfirmationBannerComponent, type: :component do
end
end
context"when org has a signed data sharing agremeent"do
context"when org has a signed data sharing agreement"do
it"does not display banner"do
expect(component.display_banner?).toeq(false)
expect(render.content).tobe_empty
@ -121,88 +133,5 @@ RSpec.describe DataProtectionConfirmationBannerComponent, type: :component do
end
end
end
context"when org does not have a DPO"do
beforedo
organisation.users.where(is_dpo:true).destroy_all
end
it"displays the banner"do
expect(component.display_banner?).toeq(true)
expect(render).tohave_link(
"Contact helpdesk to assign a data protection officer",
expect(render).tohave_selector("p",text:"To create logs your organisation must state a data protection officer. They must sign the Data Sharing Agreement.")
end
end
context"when org has a DPO"do
context"when org does not have a signed data sharing agreement"do