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 @@ > - +