From b77a09986136750a8c778e4a27e9dd04925b6741 Mon Sep 17 00:00:00 2001 From: Nicholas Case Date: Mon, 20 Aug 2018 10:11:45 -0700 Subject: [PATCH] 160 add companyName to configuration options --- spec/configuration.spec.js | 12 +++++ src/components/popup/intro/intro.jsx | 4 +- src/components/popup/intro/introV2.jsx | 4 +- src/e2e/company_name.html | 61 ++++++++++++++++++++++++++ src/lib/config.js | 1 + webpack.config.babel.js | 5 +++ 6 files changed, 85 insertions(+), 2 deletions(-) create mode 100644 src/e2e/company_name.html diff --git a/spec/configuration.spec.js b/spec/configuration.spec.js index eafa6ce..d642c93 100644 --- a/spec/configuration.spec.js +++ b/spec/configuration.spec.js @@ -100,4 +100,16 @@ describe('different configurations', () => { }); }); + describe('Company Name', () => { + beforeEach(() => { + browser.get("/e2e/company_name.html"); + browser.sleep(300); + }); + + it('title contains the company name specified in the config', () => { + const el = element.all(by.css('[class^=intro_title]')).first(); + expect(el.getText()).toContain("Roadrunner and Coyote Enterprises"); + }); + }); + }); diff --git a/src/components/popup/intro/intro.jsx b/src/components/popup/intro/intro.jsx index f20ed50..e9936f3 100644 --- a/src/components/popup/intro/intro.jsx +++ b/src/components/popup/intro/intro.jsx @@ -40,7 +40,9 @@ export default class Intro extends Component { }
Thanks for visiting - + {config && config.companyName && + {config.companyName} + }
Ads help us run this site. When you use our site selected companies may access and use information on your device for various purposes including to serve relevant ads or personalised content. diff --git a/src/components/popup/intro/introV2.jsx b/src/components/popup/intro/introV2.jsx index 0735247..861a694 100644 --- a/src/components/popup/intro/introV2.jsx +++ b/src/components/popup/intro/introV2.jsx @@ -41,7 +41,9 @@ export default class IntroV2 extends Component { }
Thanks for visiting - + {config && config.companyName && + {config.companyName} + }
diff --git a/src/e2e/company_name.html b/src/e2e/company_name.html new file mode 100644 index 0000000..f1d8352 --- /dev/null +++ b/src/e2e/company_name.html @@ -0,0 +1,61 @@ + + + + + GDPR Documentation + + + + + + Some Link +

Some Text

+ + + diff --git a/src/lib/config.js b/src/lib/config.js index aad093e..e3e9f98 100644 --- a/src/lib/config.js +++ b/src/lib/config.js @@ -1,6 +1,7 @@ import log from './log'; const metadata = require('../../metadata.json'); const defaultConfig = { + companyName: null, storePublisherData: true, customPurposeListLocation: null, storeConsentGlobally: true, diff --git a/webpack.config.babel.js b/webpack.config.babel.js index 3764fd6..2902bc4 100644 --- a/webpack.config.babel.js +++ b/webpack.config.babel.js @@ -203,6 +203,11 @@ module.exports = [ template: 'e2e/layout-thin.html', chunks: ['e2e'] }), + new HtmlWebpackPlugin({ + filename: 'e2e/company_name.html', + template: 'e2e/company_name.html', + chunks: ['e2e'] + }), // Static assets copy new CopyWebpackPlugin([ { from: './geoip.json' }