[ADF-3512] SidenavLayoutComponent option to show the sidebar on the right (#3768)

* add sidebar end start property

* add demo and test

* fix test

* fix failing test
This commit is contained in:
Eugenio Romano
2018-09-12 10:02:24 +01:00
committed by GitHub
parent 3d5da1e622
commit cc396e2a11
16 changed files with 186 additions and 79 deletions

View File

@@ -114,13 +114,33 @@ describe('HeaderLayoutComponent', () => {
expect(button === null).toBeFalsy();
});
it('if showSidenavToggle is false the button menu should not be displayed', () => {
it('if showSidenavToggle is false the button menu should not be displayed', () => {
component.showSidenavToggle = false;
fixture.detectChanges();
const button = fixture.nativeElement.querySelector('.adf-menu-icon');
expect(button === null).toBeTruthy();
});
it('if position is end the button menu should be at the end', () => {
component.position = 'end';
fixture.detectChanges();
const buttonStart = fixture.nativeElement.querySelector('#adf-sidebar-toggle-start');
const buttonEnd = fixture.nativeElement.querySelector('#adf-sidebar-toggle-end');
expect(buttonStart === null).toBeTruthy();
expect(buttonEnd === null).toBeFalsy();
});
it('if position is start the button menu should be at the start', () => {
component.position = 'start';
fixture.detectChanges();
const buttonStart = fixture.nativeElement.querySelector('#adf-sidebar-toggle-start');
const buttonEnd = fixture.nativeElement.querySelector('#adf-sidebar-toggle-end');
expect(buttonStart === null).toBeFalsy();
expect(buttonEnd === null).toBeTruthy();
});
});
describe('Template tranclusion', () => {