mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
hide close button viewer in not overlay mode
This commit is contained in:
parent
393b66602a
commit
2e8644b4bc
@ -20,7 +20,7 @@
|
||||
<!-- Start Navigation -->
|
||||
<nav class="mdl-navigation">
|
||||
<div id="viewer-toolbar-view-options">
|
||||
<button
|
||||
<button *ngIf="overlayMode"
|
||||
class="mdl-color--black mdl-button mdl-js-button mdl-button--fab mdl-button--mini-fab mdl-button--colored" (click)="close()">
|
||||
<i id="viewer-close-button" class="icon material-icons">close</i>
|
||||
</button>
|
||||
|
@ -70,13 +70,14 @@ import { EventMock } from './assets/event.mock';
|
||||
});
|
||||
}));
|
||||
|
||||
it('Close button should be present', inject([TestComponentBuilder], (tcb: TestComponentBuilder) => {
|
||||
it('Close button should be present if 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();
|
||||
|
||||
@ -84,6 +85,22 @@ import { EventMock } from './assets/event.mock';
|
||||
});
|
||||
}));
|
||||
|
||||
it('Close button should be not 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('#viewer-close-button')).toBeNull();
|
||||
});
|
||||
}));
|
||||
|
||||
|
||||
it('Click on close button should hide the viewer', inject([TestComponentBuilder], (tcb: TestComponentBuilder) => {
|
||||
return tcb
|
||||
.createAsync(ViewerComponent)
|
||||
@ -91,6 +108,7 @@ import { EventMock } from './assets/event.mock';
|
||||
let element = fixture.nativeElement;
|
||||
let component = fixture.componentInstance;
|
||||
component.urlFile = 'fake-url-file';
|
||||
component.overlayMode = true;
|
||||
|
||||
fixture.detectChanges();
|
||||
element.querySelector('#viewer-close-button').click();
|
||||
|
Loading…
x
Reference in New Issue
Block a user