From ca50613fc7b57011302f443ed5d670d949851b4d Mon Sep 17 00:00:00 2001 From: Andrew Georgiou Date: Tue, 14 May 2019 12:04:57 +0100 Subject: [PATCH] WIP - adding the Beta origami o-permutive component to enable a trial of Permutives functionality --- .../o-errors/test/filter-error.spec.js | 4 +-- browser/layout/wrapper.html | 1 - components/n-ui/ads/index.js | 26 +++++++++---------- components/n-ui/ads/js/krux.js | 2 +- components/n-ui/ads/test/helpers/markup.js | 2 +- components/n-ui/ads/test/oAdsConfig.spec.js | 6 ++--- .../tracking/ft/events/navigation-timing.js | 2 +- .../tracking/test/ft/utils/getDomPath.spec.js | 2 +- 8 files changed, 22 insertions(+), 23 deletions(-) diff --git a/browser/bundles/o-errors/test/filter-error.spec.js b/browser/bundles/o-errors/test/filter-error.spec.js index 8c3e3a235..5d4a3db9c 100644 --- a/browser/bundles/o-errors/test/filter-error.spec.js +++ b/browser/bundles/o-errors/test/filter-error.spec.js @@ -29,8 +29,8 @@ describe('filter error', () => { 'undefined is not a function (evaluating \'Object.assign(window.FT.flags', 'The installing service worker became redundant.' ].map(err => it(`should filter "${err}"`, () => { - const result = filterError({ exception: buildExceptionObject(err) }); - expect(result).to.equal(false); + const result = filterError({ exception: buildExceptionObject(err) }); + expect(result).to.equal(false); })); diff --git a/browser/layout/wrapper.html b/browser/layout/wrapper.html index 0d5707294..55a910f36 100644 --- a/browser/layout/wrapper.html +++ b/browser/layout/wrapper.html @@ -135,7 +135,6 @@ }; {{/if}} -
{{#outputBlock 'above-header'}}{{/outputBlock}} diff --git a/components/n-ui/ads/index.js b/components/n-ui/ads/index.js index ea40858cd..36b97550b 100644 --- a/components/n-ui/ads/index.js +++ b/components/n-ui/ads/index.js @@ -68,19 +68,19 @@ export default { }); if (flags && flags.get('AdsPermutive')) { let oPermConf = { - "appInfo" : { - "appName" : "article", - "contentId" : "5cfae92e-6cc5-11e9-80c7-60ee53e6681d" - }, - "publicApiKeys" : { - "id" : "e1c3fd73-dd41-4abd-b80b-4278d52bf7aa", - "key" : "b2b3b748-e1f6-4bd5-b2f2-26debc8075a3" - }, - "adsApi" : { - "user" : "https://ads-api.ft.com/v1/user", - "content" : "https://ads-api.ft.com/v1/content/" - } + 'appInfo' : { + 'appName' : 'article', + 'contentId' : '5cfae92e-6cc5-11e9-80c7-60ee53e6681d' + }, + 'publicApiKeys' : { + 'id' : 'e1c3fd73-dd41-4abd-b80b-4278d52bf7aa', + 'key' : 'b2b3b748-e1f6-4bd5-b2f2-26debc8075a3' + }, + 'adsApi' : { + 'user' : 'https://ads-api.ft.com/v1/user', + 'content' : 'https://ads-api.ft.com/v1/content/' } + }; oPermutive.init(false, oPermConf); } const adOptions = typeof opts === 'object' ? opts : {}; @@ -110,6 +110,6 @@ export default { }); } - }); + }); } }; diff --git a/components/n-ui/ads/js/krux.js b/components/n-ui/ads/js/krux.js index 67120cf37..cfa8a5a10 100644 --- a/components/n-ui/ads/js/krux.js +++ b/components/n-ui/ads/js/krux.js @@ -35,7 +35,7 @@ function init (flags) { // DoubleClick handles display advertising. This matches up the user ID formats so Krux can send segment populations to them. if(flags.get('kruxGoogleIntegration')) { - frequencyCap('doubleclick', 2, () => { addPixel('https://usermatch.krxd.net/um/v2?partner=google'); }); + frequencyCap('doubleclick', 2, () => { addPixel('https://usermatch.krxd.net/um/v2?partner=google'); }); } // The following four scripts are user matching scripts for Kruxdata partners diff --git a/components/n-ui/ads/test/helpers/markup.js b/components/n-ui/ads/test/helpers/markup.js index 203c706ce..15ef91023 100644 --- a/components/n-ui/ads/test/helpers/markup.js +++ b/components/n-ui/ads/test/helpers/markup.js @@ -11,7 +11,7 @@ function set (markup) { function destroyContainer () { if (container.parentNode) { - container.parentNode.removeChild(container); + container.parentNode.removeChild(container); } } diff --git a/components/n-ui/ads/test/oAdsConfig.spec.js b/components/n-ui/ads/test/oAdsConfig.spec.js index a2256cd2f..a7d23bff0 100644 --- a/components/n-ui/ads/test/oAdsConfig.spec.js +++ b/components/n-ui/ads/test/oAdsConfig.spec.js @@ -95,10 +95,10 @@ describe('Config', () => { sandbox.stub(utils, 'getMetaData').callsFake((param) => { switch (param) { case 'dfp_site': - return 'testDfpSite'; + return 'testDfpSite'; break; case 'dfp_zone': - return 'testDfpZone'; + return 'testDfpZone'; break; } }); @@ -112,7 +112,7 @@ describe('Config', () => { describe('lazyLoad viewportMargin', () => { - // tests for adOptimizeLazyLoad flag + // tests for adOptimizeLazyLoad flag it('Should pass 0% when screen size is wider than 980px', () => { sandbox.stub(utils, 'getScreenSize').callsFake(() => { return 980; }); const flags = { get: () => true }; diff --git a/components/n-ui/tracking/ft/events/navigation-timing.js b/components/n-ui/tracking/ft/events/navigation-timing.js index 6247bffd2..529810d1a 100644 --- a/components/n-ui/tracking/ft/events/navigation-timing.js +++ b/components/n-ui/tracking/ft/events/navigation-timing.js @@ -49,7 +49,7 @@ const getMarks = performance => marks[mark.name] = Math.round(mark.startTime); return marks; }, {}) : - {}; + {}; const getCustom = (window, performance) => { const custom = {}; diff --git a/components/n-ui/tracking/test/ft/utils/getDomPath.spec.js b/components/n-ui/tracking/test/ft/utils/getDomPath.spec.js index 7ee42a6b8..615fcd7ed 100644 --- a/components/n-ui/tracking/test/ft/utils/getDomPath.spec.js +++ b/components/n-ui/tracking/test/ft/utils/getDomPath.spec.js @@ -81,6 +81,6 @@ describe('getDomPath', function () { `; const path = getDomPath(document.getElementById('x1'), []); expect(path).to.deep.equal(['b', 'c']); - expect(document.getElementById('x2').getAttribute('data-trackable')).to.equal('b'); + expect(document.getElementById('x2').getAttribute('data-trackable')).to.equal('b'); }); });