Skip to content

Commit

Permalink
bugfix(PPDSC-2208): removed extra script (#220)
Browse files Browse the repository at this point in the history
* bugfix(PPDSC-2208): removed extra script

* fix(PPDSC-2208): removed unused var

* fix(PPDSC-2208): commented consent cy test
  • Loading branch information
Vanals authored Jun 7, 2022
1 parent 9a54749 commit a50e6f1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 25 deletions.
20 changes: 10 additions & 10 deletions cypress/site/functional/consent.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ 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.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');
// 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');
});
});
17 changes: 2 additions & 15 deletions site/pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import * as React from 'react';
import Document, {Head, Main, NextScript, Html} from 'next/document';
import {Consent, Global, css, Tealium} from 'newskit';
import {Global, css} from 'newskit';
import Helmet from 'react-helmet';
import {HTMLMeta} from '../components/html-meta';

Expand All @@ -16,7 +16,7 @@ const Base = () => <base href={baseHref} />;

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

0 comments on commit a50e6f1

Please sign in to comment.