mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-26 17:24:56 +00:00
hide header in not overlay mode
This commit is contained in:
parent
99f5744543
commit
f064cb0bea
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
<!-- Start Layout -->
|
<!-- Start Layout -->
|
||||||
<div mdl class="mdl-layout mdl-js-layout mdl-layout--fixed-header">
|
<div mdl class="mdl-layout mdl-js-layout mdl-layout--fixed-header">
|
||||||
<header class="mdl-layout__header">
|
<header *ngIf="overlayMode" class="mdl-layout__header">
|
||||||
<div class="mdl-layout__header-row">
|
<div class="mdl-layout__header-row">
|
||||||
|
|
||||||
<!-- File Title -->
|
<!-- File Title -->
|
||||||
|
@ -23,7 +23,7 @@ import { EventMock } from './assets/event.mock';
|
|||||||
describe('ViewerComponent', () => {
|
describe('ViewerComponent', () => {
|
||||||
|
|
||||||
describe('View', () => {
|
describe('View', () => {
|
||||||
it('shadow overlay should be present if overlay is true', inject([TestComponentBuilder], (tcb: TestComponentBuilder) => {
|
it('shadow overlay should be present if is overlay mode', inject([TestComponentBuilder], (tcb: TestComponentBuilder) => {
|
||||||
return tcb
|
return tcb
|
||||||
.createAsync(ViewerComponent)
|
.createAsync(ViewerComponent)
|
||||||
.then((fixture) => {
|
.then((fixture) => {
|
||||||
@ -38,13 +38,45 @@ import { EventMock } from './assets/event.mock';
|
|||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
|
|
||||||
it('Name File should be present', inject([TestComponentBuilder], (tcb: TestComponentBuilder) => {
|
it('header should be present if is overlay mode', inject([TestComponentBuilder], (tcb: TestComponentBuilder) => {
|
||||||
|
return tcb
|
||||||
|
.createAsync(ViewerComponent)
|
||||||
|
.then((fixture) => {
|
||||||
|
let element = fixture.nativeElement;
|
||||||
|
let component = fixture.componentInstance;
|
||||||
|
component.urlFile = 'fake-url-file';
|
||||||
|
component.overlayMode = true;
|
||||||
|
|
||||||
|
fixture.detectChanges();
|
||||||
|
|
||||||
|
expect(element.querySelector('header')).not.toBeNull();
|
||||||
|
});
|
||||||
|
}));
|
||||||
|
|
||||||
|
|
||||||
|
it('header should be NOT be present if is not overlay mode', inject([TestComponentBuilder], (tcb: TestComponentBuilder) => {
|
||||||
|
return tcb
|
||||||
|
.createAsync(ViewerComponent)
|
||||||
|
.then((fixture) => {
|
||||||
|
let element = fixture.nativeElement;
|
||||||
|
let component = fixture.componentInstance;
|
||||||
|
component.urlFile = 'fake-url-file';
|
||||||
|
component.overlayMode = false;
|
||||||
|
|
||||||
|
fixture.detectChanges();
|
||||||
|
|
||||||
|
expect(element.querySelector('header')).toBeNull();
|
||||||
|
});
|
||||||
|
}));
|
||||||
|
|
||||||
|
it('Name File should be present if is overlay mode ', inject([TestComponentBuilder], (tcb: TestComponentBuilder) => {
|
||||||
return tcb
|
return tcb
|
||||||
.createAsync(ViewerComponent)
|
.createAsync(ViewerComponent)
|
||||||
.then((fixture) => {
|
.then((fixture) => {
|
||||||
let element = fixture.nativeElement;
|
let element = fixture.nativeElement;
|
||||||
let component = fixture.componentInstance;
|
let component = fixture.componentInstance;
|
||||||
component.urlFile = 'http://localhost:9876/fake-url-file.pdf';
|
component.urlFile = 'http://localhost:9876/fake-url-file.pdf';
|
||||||
|
component.overlayMode = true;
|
||||||
|
|
||||||
component.ngOnChanges().then(() => {
|
component.ngOnChanges().then(() => {
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
@ -117,7 +149,7 @@ import { EventMock } from './assets/event.mock';
|
|||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
|
|
||||||
it('Esc button should not hide the viewer if is not overlay mode', inject([TestComponentBuilder], (tcb: TestComponentBuilder) => {
|
it('Esc button should not hide the viewerls if is not overlay mode', inject([TestComponentBuilder], (tcb: TestComponentBuilder) => {
|
||||||
return tcb
|
return tcb
|
||||||
.createAsync(ViewerComponent)
|
.createAsync(ViewerComponent)
|
||||||
.then((fixture) => {
|
.then((fixture) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user