From 16dc33cc05e8ac2f4e6572b140734f615434197d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Wed, 20 Feb 2019 15:03:32 +0100 Subject: [PATCH] fix issue with navbar in home menu with no active app --- web/static/src/xml/templates.xml | 2 +- .../tests/widgets/__snapshots__/navbar.test.ts.snap | 13 ++++++++++--- .../tests/widgets/__snapshots__/root.test.ts.snap | 2 +- web/static/tests/widgets/navbar.test.ts | 10 +++++++++- 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/web/static/src/xml/templates.xml b/web/static/src/xml/templates.xml index 07158f4e..68909d76 100644 --- a/web/static/src/xml/templates.xml +++ b/web/static/src/xml/templates.xml @@ -14,7 +14,7 @@
- + diff --git a/web/static/tests/widgets/__snapshots__/navbar.test.ts.snap b/web/static/tests/widgets/__snapshots__/navbar.test.ts.snap index afd31309..90d64a92 100644 --- a/web/static/tests/widgets/__snapshots__/navbar.test.ts.snap +++ b/web/static/tests/widgets/__snapshots__/navbar.test.ts.snap @@ -1,8 +1,15 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`can be rendered 1`] = ` -"
- +exports[`can be rendered (in home menu, no app) 1`] = ` +"
+ + +
" +`; + +exports[`can be rendered (in home menu, one active app) 1`] = ` +"
+
" `; diff --git a/web/static/tests/widgets/__snapshots__/root.test.ts.snap b/web/static/tests/widgets/__snapshots__/root.test.ts.snap index 4fcb1719..70a40fe9 100644 --- a/web/static/tests/widgets/__snapshots__/root.test.ts.snap +++ b/web/static/tests/widgets/__snapshots__/root.test.ts.snap @@ -3,7 +3,7 @@ exports[`can be rendered (in home menu) 1`] = ` "
- +
diff --git a/web/static/tests/widgets/navbar.test.ts b/web/static/tests/widgets/navbar.test.ts index 8f499aa2..a76fcbea 100644 --- a/web/static/tests/widgets/navbar.test.ts +++ b/web/static/tests/widgets/navbar.test.ts @@ -34,7 +34,15 @@ afterEach(() => { // Tests //------------------------------------------------------------------------------ -test("can be rendered", async () => { +test("can be rendered (in home menu, no app)", async () => { + props.inHome = true; + const navbar = new Navbar(env, props); + await navbar.mount(fixture); + expect(fixture.innerHTML).toMatchSnapshot(); +}); + +test("can be rendered (in home menu, one active app)", async () => { + props = { inHome: true, app: menuInfo.menus[96]! }; const navbar = new Navbar(env, props); await navbar.mount(fixture); expect(fixture.innerHTML).toMatchSnapshot();