Files
grecia/spec/components/layout/cookies_consent/banner_component_spec.rb
taitus 4c0b6455f6 Add cookies consent banner
Allow enabling from settings admin section.

Note that we set the z-index to 20 in order to will be greater than
the others z-index elements in the application like <header> on
mobile devices.
2025-01-23 16:05:40 +01:00

21 lines
606 B
Ruby

require "rails_helper"
describe Layout::CookiesConsent::BannerComponent do
before { Setting["feature.cookies_consent"] = true }
it "does not render the banner when feature `cookies_consent` is disabled" do
Setting["feature.cookies_consent"] = nil
render_inline Layout::CookiesConsent::BannerComponent.new
expect(page).not_to be_rendered
end
it "renders the banner content when feature `cookies_consent` is enabled" do
render_inline Layout::CookiesConsent::BannerComponent.new
expect(page).to be_rendered
expect(page).to have_css "h2", text: "Cookies policy"
end
end