Allow accept essential cookies from consent banner
Set cookie duration to 365 days based on the AEPD's cookie usage guidelines. Note from the document: "Cookies with a duration of up to 24 months are considered acceptable as long as they are periodically updated." Reference: https://www.aepd.es/guias/guia-cookies.pdf
This commit is contained in:
@@ -3,6 +3,14 @@ require "rails_helper"
|
||||
describe Layout::CookiesConsent::BannerComponent do
|
||||
before { Setting["feature.cookies_consent"] = true }
|
||||
|
||||
it "does not render the banner when cookies were accepted" do
|
||||
vc_test_request.cookies[:cookies_consent] = "essential"
|
||||
|
||||
render_inline Layout::CookiesConsent::BannerComponent.new
|
||||
|
||||
expect(page).not_to be_rendered
|
||||
end
|
||||
|
||||
it "does not render the banner when feature `cookies_consent` is disabled" do
|
||||
Setting["feature.cookies_consent"] = nil
|
||||
|
||||
@@ -11,10 +19,11 @@ describe Layout::CookiesConsent::BannerComponent do
|
||||
expect(page).not_to be_rendered
|
||||
end
|
||||
|
||||
it "renders the banner content when feature `cookies_consent` is enabled" do
|
||||
it "renders the banner content when feature `cookies_consent` is enabled and cookies were not accepted" do
|
||||
render_inline Layout::CookiesConsent::BannerComponent.new
|
||||
|
||||
expect(page).to be_rendered
|
||||
expect(page).to have_css "h2", text: "Cookies policy"
|
||||
expect(page).to have_button "Accept essential cookies"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user