From ea513e25156fe1f5f46909a6a6becb2e262eca9d Mon Sep 17 00:00:00 2001 From: Marco Vanali Date: Thu, 14 Jul 2022 13:48:59 +0100 Subject: [PATCH] Fix/ppdsc 2208 Fix svg previewer: remove sourcepoint and tealium in dev (#276) * docs(PPDSC-0000): testing permissions * docs(PPDSC-0000): removing test changed from readme * fix(PPDSC-2208): implemented conditional for tealium and sorcpoint scrip * fix(PPDSC-2208): remove scripts from dev * fix(PPDSC-2208): removing e2e tests for consent --- cypress/site/functional/consent.spec.js | 36 +++++++++++++------------ site/pages/_document.tsx | 31 ++++++++++++--------- 2 files changed, 37 insertions(+), 30 deletions(-) diff --git a/cypress/site/functional/consent.spec.js b/cypress/site/functional/consent.spec.js index 11ccf10d16..ae75106571 100644 --- a/cypress/site/functional/consent.spec.js +++ b/cypress/site/functional/consent.spec.js @@ -1,18 +1,20 @@ -describe('Consent component', () => { - it('should show up and verify cookie banner does not pop up anymore once user accepts the cookie consent', () => { - // They have been set for the previous tests in order to be able to run them correctly. - // For the purpose of the following test they need to be cleared first. - cy.clearCookie('euconsent-v2'); - cy.clearCookie('consentUUID'); +// Removed with the PR: https://github.com/newscorp-ghfb/newskit/pull/276 +// TODO bring it back once put back for dev environment +// describe('Consent component', () => { +// it('should show up and verify cookie banner does not pop up anymore once user accepts the cookie consent', () => { +// // They have been set for the previous tests in order to be able to run them correctly. +// // For the purpose of the following test they need to be cleared first. +// cy.clearCookie('euconsent-v2'); +// cy.clearCookie('consentUUID'); - cy.visit('/'); - const iFrame = "iframe[id^='sp_message_iframe']"; - cy.get(iFrame, {timeout: 10000}).should('be.visible'); - cy.acceptCookieBanner(); - // Non TCF and TCF behave differently in this regard,hidden and removed respectively, we need to support both during switch over - // TODO: uncomment once PPDSC-1504 released - cy.get(iFrame).should('not.exist'); - cy.reload(); - cy.get(iFrame, {timeout: 10000}).should('not.exist'); - }); -}); +// cy.visit('/'); +// const iFrame = "iframe[id^='sp_message_iframe']"; +// cy.get(iFrame, {timeout: 10000}).should('be.visible'); +// cy.acceptCookieBanner(); +// // Non TCF and TCF behave differently in this regard,hidden and removed respectively, we need to support both during switch over +// // TODO: uncomment once PPDSC-1504 released +// cy.get(iFrame).should('not.exist'); +// cy.reload(); +// cy.get(iFrame, {timeout: 10000}).should('not.exist'); +// }); +// }); diff --git a/site/pages/_document.tsx b/site/pages/_document.tsx index 17a3e5fb29..f4a0f1dd72 100644 --- a/site/pages/_document.tsx +++ b/site/pages/_document.tsx @@ -17,6 +17,7 @@ const Base = () => ; export default class MyDocument extends Document { render() { const isSiteEnvProduction = process.env.SITE_ENV === 'production'; + const helmet = Helmet.rewind(); return ( @@ -35,14 +36,16 @@ export default class MyDocument extends Document { {helmet.script.toComponent()} - + {isSiteEnvProduction && ( + + )} - + {isSiteEnvProduction && ( + + )}