From 3294606fc08a57a5455265e3fb76f48b98bb2224 Mon Sep 17 00:00:00 2001 From: Tomasz Gnyp <49343696+tomgny@users.noreply.github.com> Date: Fri, 3 Mar 2023 13:49:31 +0100 Subject: [PATCH] =?UTF-8?q?[AAE-12877]=20Fix=20-=20The=20left=20sidebar=20?= =?UTF-8?q?menu=20is=20not=20expanding=20after=20clicki=E2=80=A6=20(#3023)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [AAE-12877] Fix - The left sidebar menu is not expanding after clicking on hamburger menu * unit test improvement --- .../lib/components/header/header.component.spec.ts | 14 +++++++++++++- .../layout/app-layout/app-layout.component.html | 8 +++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/projects/aca-content/src/lib/components/header/header.component.spec.ts b/projects/aca-content/src/lib/components/header/header.component.spec.ts index 9a4c8ddf7..23fdb845c 100644 --- a/projects/aca-content/src/lib/components/header/header.component.spec.ts +++ b/projects/aca-content/src/lib/components/header/header.component.spec.ts @@ -31,7 +31,7 @@ import { ContentActionRef } from '@alfresco/adf-extensions'; import { Store } from '@ngrx/store'; import { AppTestingModule } from '../../testing/app-testing.module'; import { AppExtensionService, SharedToolbarModule } from '@alfresco/aca-shared'; -import { CoreModule } from '@alfresco/adf-core'; +import { CoreModule, SidenavLayoutComponent } from '@alfresco/adf-core'; import { AppSearchInputModule } from '../search/search-input.module'; import { By } from '@angular/platform-browser'; @@ -95,6 +95,18 @@ describe('AppHeaderComponent', () => { expect(component.actions).toEqual(actions); })); + it('should minimize sidenav on toggle sidenav click', () => { + const layout = TestBed.createComponent(SidenavLayoutComponent); + const mockData: any = { layout: layout.componentInstance, isMenuMinimized: true }; + component.data = mockData; + + const toggleMenuSpy = spyOn(component.data.layout, 'toggleMenu'); + component.onToggleSidenav(true); + + expect(toggleMenuSpy).toHaveBeenCalled(); + expect(component.isSidenavExpanded).toBe(false); + }); + describe('Search input', () => { beforeEach(() => { localStorage.clear(); diff --git a/projects/aca-content/src/lib/components/layout/app-layout/app-layout.component.html b/projects/aca-content/src/lib/components/layout/app-layout/app-layout.component.html index 9cab121c1..17be622bf 100644 --- a/projects/aca-content/src/lib/components/layout/app-layout/app-layout.component.html +++ b/projects/aca-content/src/lib/components/layout/app-layout/app-layout.component.html @@ -10,7 +10,13 @@ > - +