CLDC-4114: Silence DPO warning if DSA is signed (#3143)
* CLDC-4114: Silence DPO warning if DSA is signed
also restructure redundant logic in the file
* CLDC-4114: Update tests
* fixup! CLDC-4114: Silence DPO warning if DSA is signed
Co-authored-by: Oscar Richardson <116292912+oscar-richardson-softwire@users.noreply.github.com>
* CLDC-4114: Restructure data protection confirmation banner tests
* fixup! CLDC-4114: Restructure data protection confirmation banner tests
* fixup! CLDC-4114: Restructure data protection confirmation banner tests
fix typo
Co-authored-by: Oscar Richardson <116292912+oscar-richardson-softwire@users.noreply.github.com>
* CLDC-4114: Lint after merge
since rubocop updated
---------
Co-authored-by: Oscar Richardson <116292912+oscar-richardson-softwire@users.noreply.github.com>
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?).tobe(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?).tobe(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?).tobe(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