mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-12 17:04:46 +00:00
[AAE-12877] Fix - The left sidebar menu is not expanding after clicki… (#3023)
* [AAE-12877] Fix - The left sidebar menu is not expanding after clicking on hamburger menu * unit test improvement
This commit is contained in:
parent
e2ca341866
commit
3294606fc0
@ -31,7 +31,7 @@ import { ContentActionRef } from '@alfresco/adf-extensions';
|
|||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { AppTestingModule } from '../../testing/app-testing.module';
|
import { AppTestingModule } from '../../testing/app-testing.module';
|
||||||
import { AppExtensionService, SharedToolbarModule } from '@alfresco/aca-shared';
|
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 { AppSearchInputModule } from '../search/search-input.module';
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
|
|
||||||
@ -95,6 +95,18 @@ describe('AppHeaderComponent', () => {
|
|||||||
expect(component.actions).toEqual(actions);
|
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', () => {
|
describe('Search input', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
localStorage.clear();
|
localStorage.clear();
|
||||||
|
@ -10,7 +10,13 @@
|
|||||||
>
|
>
|
||||||
<adf-sidenav-layout-header>
|
<adf-sidenav-layout-header>
|
||||||
<ng-template let-isMenuMinimized="isMenuMinimized">
|
<ng-template let-isMenuMinimized="isMenuMinimized">
|
||||||
<app-header role="heading" aria-level="1" *ngIf="!hideSidenav" (toggleClicked)="layout.toggleMenu()" [expandedSidenav]="!isMenuMinimized()">
|
<app-header
|
||||||
|
*ngIf="!hideSidenav"
|
||||||
|
role="heading"
|
||||||
|
aria-level="1"
|
||||||
|
(toggleClicked)="layout.toggleMenu()"
|
||||||
|
[data]="{ layout }"
|
||||||
|
[expandedSidenav]="!isMenuMinimized()">
|
||||||
</app-header>
|
</app-header>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</adf-sidenav-layout-header>
|
</adf-sidenav-layout-header>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user