mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
[ACS-5654] Unit tests
This commit is contained in:
@@ -63,6 +63,7 @@ import { matIconRegistryMock } from '../../testing/mat-icon-registry-mock';
|
||||
import { domSanitizerMock } from '../../testing/dom-sanitizer-mock';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { FileAutoDownloadComponent } from './file-auto-download/file-auto-download.component';
|
||||
import { ShareDataTableAdapter } from '../public-api';
|
||||
|
||||
const mockDialog = {
|
||||
open: jasmine.createSpy('open')
|
||||
@@ -278,6 +279,15 @@ describe('DocumentList', () => {
|
||||
expect(documentList.selection).toEqual([]);
|
||||
});
|
||||
|
||||
it('should show the header when there are no records in the table but filter is active', () => {
|
||||
documentList.data = new ShareDataTableAdapter(thumbnailService, contentService, []);
|
||||
documentList.filterValue = { $thumbnail: 'TYPE:"cm:folder"' };
|
||||
|
||||
fixture.detectChanges();
|
||||
|
||||
expect(documentList.showHeader).toEqual('always');
|
||||
});
|
||||
|
||||
it('should reloadWithoutResettingSelection not reset the selection', () => {
|
||||
documentList.selection = [{ entry: mockNode3 }];
|
||||
documentList.reloadWithoutResettingSelection();
|
||||
|
||||
@@ -236,6 +236,7 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
|
||||
/** @hidden */
|
||||
@Input()
|
||||
_rowFilter: RowFilter | null = null;
|
||||
documentList: any[];
|
||||
|
||||
/**
|
||||
* Custom function to choose whether to show or hide rows.
|
||||
@@ -451,7 +452,7 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
|
||||
.subscribe(val => this.contextActionCallback(val));
|
||||
|
||||
this.enforceSingleClickNavigationForMobile();
|
||||
if (Object.keys(this.filterValue).length > 0) {
|
||||
if (this.filterValue && Object.keys(this.filterValue).length > 0) {
|
||||
this.showHeader = ShowHeaderMode.Always;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user