Skip to content

Commit

Permalink
Fix/ppdsc 2208 Fix svg previewer: remove sourcepoint and tealium in d…
Browse files Browse the repository at this point in the history
…ev (#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
  • Loading branch information
Vanals authored Jul 14, 2022
1 parent 3c1dcdc commit ea513e2
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 30 deletions.
36 changes: 19 additions & 17 deletions cypress/site/functional/consent.spec.js
Original file line number Diff line number Diff line change
@@ -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');
// });
// });
31 changes: 18 additions & 13 deletions site/pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const Base = () => <base href={baseHref} />;
export default class MyDocument extends Document {
render() {
const isSiteEnvProduction = process.env.SITE_ENV === 'production';

const helmet = Helmet.rewind();
return (
<Html lang="en">
Expand All @@ -35,14 +36,16 @@ export default class MyDocument extends Document {
</style>
{helmet.script.toComponent()}
<HTMLMeta />
<Consent
sourcePointConfigUnified={{
accountId: 259,
propertyHref: 'https://newskit.co.uk',
gdpr: {},
}}
reactHelmet={Helmet}
/>
{isSiteEnvProduction && (
<Consent
sourcePointConfigUnified={{
accountId: 259,
propertyHref: 'https://newskit.co.uk',
gdpr: {},
}}
reactHelmet={Helmet}
/>
)}
</Head>
<body>
<Global
Expand Down Expand Up @@ -234,11 +237,13 @@ export default class MyDocument extends Document {
}
`}
/>
<Tealium
accountId="newsinternational"
profileId="thetimes.newskit"
env={isSiteEnvProduction ? 'prod' : 'dev'}
/>
{isSiteEnvProduction && (
<Tealium
accountId="newsinternational"
profileId="thetimes.newskit"
env={isSiteEnvProduction ? 'prod' : 'dev'}
/>
)}
<Main />
<NextScript />
</body>
Expand Down

0 comments on commit ea513e2

Please sign in to comment.