From 87f9017b1ffc464e85cadc5103b533b39cee95fc Mon Sep 17 00:00:00 2001 From: papegaill Date: Tue, 29 Oct 2019 16:57:04 +0100 Subject: [PATCH] fix(site-header-harmonised): Add missing group class - TWIG-106 (#196) --- .../ec-component-site-header-harmonised/README.md | 2 ++ .../site-header-harmonised.test.js.snap | 12 ++++++------ .../site-header-harmonised.html.twig | 4 +++- .../site-header-harmonised.story.js | 2 ++ .../site-header-harmonised.test.js | 2 ++ 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/ec/packages/ec-component-site-header-harmonised/README.md b/src/ec/packages/ec-component-site-header-harmonised/README.md index 895a6088f..0d332e979 100644 --- a/src/ec/packages/ec-component-site-header-harmonised/README.md +++ b/src/ec/packages/ec-component-site-header-harmonised/README.md @@ -10,6 +10,7 @@ npm install --save @ecl-twig/ec-component-site-header-harmonised ### Parameters +- "group" (string) (default: 'group1'): 'group1' or 'group2' - "logged" (boolean) (default: false): Whether the user is logged in or not - "menu" (boolean) (default: false): Whether the component includes a menu or not - "menu_label" (string) (default: false): The menu toggler label @@ -57,6 +58,7 @@ npm install --save @ecl-twig/ec-component-site-header-harmonised ```twig {% include '@ecl-twig/ec-component-site-header-harmonised/site-header-harmonised.html.twig' with { + group: 'group1', bannerTop: 'Class name', banner: 'Site name', menu: true, diff --git a/src/ec/packages/ec-component-site-header-harmonised/__snapshots__/site-header-harmonised.test.js.snap b/src/ec/packages/ec-component-site-header-harmonised/__snapshots__/site-header-harmonised.test.js.snap index d76ea70c1..a61ebcd72 100644 --- a/src/ec/packages/ec-component-site-header-harmonised/__snapshots__/site-header-harmonised.test.js.snap +++ b/src/ec/packages/ec-component-site-header-harmonised/__snapshots__/site-header-harmonised.test.js.snap @@ -2,7 +2,7 @@ exports[`EC - Site Header Harmonised Group 1 renders correctly 1`] = `
{ + dataGroup1.group = 'group1'; dataGroup1.logged = true; dataGroup1.icon_file_path = defaultSprite; dataGroup1.logo.src = logo; @@ -26,6 +27,7 @@ storiesOf('Components/Site Headers/Harmonised', module) .add( 'group 2', () => { + dataGroup2.group = 'group2'; dataGroup2.icon_file_path = defaultSprite; dataGroup2.logo.src = logo; return siteHeaderHarmonised(dataGroup2); diff --git a/src/ec/packages/ec-component-site-header-harmonised/site-header-harmonised.test.js b/src/ec/packages/ec-component-site-header-harmonised/site-header-harmonised.test.js index c33daf990..f87771254 100644 --- a/src/ec/packages/ec-component-site-header-harmonised/site-header-harmonised.test.js +++ b/src/ec/packages/ec-component-site-header-harmonised/site-header-harmonised.test.js @@ -8,6 +8,7 @@ describe('EC - Site Header Harmonised', () => { const render = params => renderTwigFileAsNode(template, params); describe('Group 1', () => { + dataGroup1.group = 'group1'; test('renders correctly', () => { expect.assertions(1); return expect(render(dataGroup1)).resolves.toMatchSnapshot(); @@ -38,6 +39,7 @@ describe('EC - Site Header Harmonised', () => { }); describe('Group 2', () => { + dataGroup1.group = 'group2'; test('renders correctly', () => { expect.assertions(1); return expect(render(dataGroup2)).resolves.toMatchSnapshot();