mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
Fix unit tests and code coverage for document list
This commit is contained in:
@@ -22,12 +22,14 @@ import {
|
||||
beforeEach
|
||||
} from 'angular2/testing';
|
||||
import {EventEmitter} from 'angular2/core';
|
||||
import {DocumentList} from '../../src/components/document-list';
|
||||
|
||||
import {DocumentList} from './document-list';
|
||||
import {AlfrescoServiceMock} from '../assets/alfresco.service.mock';
|
||||
import {ContentActionList} from '../../src/components/content-action-list';
|
||||
import {ContentAction} from '../../src/components/content-action';
|
||||
import {DocumentActionsService} from '../../src/services/document-actions.service';
|
||||
import {FolderActionsService} from '../../src/services/folder-actions.service';
|
||||
|
||||
import {ContentActionList} from './content-action-list';
|
||||
import {ContentAction} from './content-action';
|
||||
import {DocumentActionsService} from '../services/document-actions.service';
|
||||
import {FolderActionsService} from '../services/folder-actions.service';
|
||||
|
||||
describe('ContentAction', () => {
|
||||
|
||||
@@ -175,5 +177,4 @@ describe('ContentAction', () => {
|
||||
let model = documentList.actions[0];
|
||||
model.handler('<obj>');
|
||||
});
|
||||
|
||||
});
|
||||
|
@@ -21,10 +21,11 @@ import {
|
||||
expect,
|
||||
beforeEach
|
||||
} from 'angular2/testing';
|
||||
import {DocumentList} from '../../src/components/document-list';
|
||||
|
||||
import {DocumentList} from './document-list';
|
||||
import {AlfrescoServiceMock} from '../assets/alfresco.service.mock';
|
||||
import {ContentColumnList} from '../../src/components/content-column-list';
|
||||
import {ContentColumnModel} from '../../src/models/content-column.model';
|
||||
import {ContentColumnList} from './content-column-list';
|
||||
import {ContentColumnModel} from '../models/content-column.model';
|
||||
|
||||
describe('ContentColumnList', () => {
|
||||
|
||||
|
@@ -21,10 +21,11 @@ import {
|
||||
expect,
|
||||
beforeEach
|
||||
} from 'angular2/testing';
|
||||
import {DocumentList} from '../../src/components/document-list';
|
||||
import {ContentColumn} from '../../src/components/content-column';
|
||||
|
||||
import {DocumentList} from './document-list';
|
||||
import {ContentColumn} from './content-column';
|
||||
import {AlfrescoServiceMock} from '../assets/alfresco.service.mock';
|
||||
import {ContentColumnList} from '../../src/components/content-column-list';
|
||||
import {ContentColumnList} from './content-column-list';
|
||||
|
||||
describe('ContentColumn', () => {
|
||||
|
||||
|
@@ -21,11 +21,12 @@ import {
|
||||
expect,
|
||||
beforeEach
|
||||
} from 'angular2/testing';
|
||||
import { DocumentList } from '../../src/components/document-list';
|
||||
import { ContentColumnModel } from '../../src/models/content-column.model';
|
||||
|
||||
import { DocumentList } from './document-list';
|
||||
import { ContentColumnModel } from '../models/content-column.model';
|
||||
import { AlfrescoServiceMock } from '../assets/alfresco.service.mock';
|
||||
import { MinimalNodeEntity } from '../../src/models/document-library.model';
|
||||
import { ContentActionModel } from '../../src/models/content-action.model';
|
||||
import { MinimalNodeEntity, MinimalNodeEntryEntity } from '../models/document-library.model';
|
||||
import { ContentActionModel } from '../models/content-action.model';
|
||||
|
||||
describe('DocumentList', () => {
|
||||
|
||||
@@ -256,6 +257,7 @@ describe('DocumentList', () => {
|
||||
let path = '/';
|
||||
|
||||
let node = new MinimalNodeEntity();
|
||||
node.entry = new MinimalNodeEntryEntity();
|
||||
node.entry.isFolder = true;
|
||||
node.entry.name = '<display name>';
|
||||
|
||||
@@ -285,6 +287,7 @@ describe('DocumentList', () => {
|
||||
spyOn(documentList, 'displayFolderContent').and.stub();
|
||||
|
||||
let node = new MinimalNodeEntity();
|
||||
node.entry = new MinimalNodeEntryEntity();
|
||||
node.entry.isFolder = false;
|
||||
|
||||
documentList.onItemClick(node);
|
||||
@@ -296,6 +299,7 @@ describe('DocumentList', () => {
|
||||
spyOn(documentList, 'displayFolderContent').and.stub();
|
||||
|
||||
let node = new MinimalNodeEntity();
|
||||
node.entry = new MinimalNodeEntryEntity();
|
||||
node.entry.isFolder = true;
|
||||
node.entry.name = '<display name>';
|
||||
|
||||
|
@@ -24,6 +24,7 @@ import {
|
||||
AfterContentInit,
|
||||
AfterViewChecked
|
||||
} from 'angular2/core';
|
||||
|
||||
import { AlfrescoService } from './../services/alfresco.service';
|
||||
import { MinimalNodeEntity, NodePaging } from './../models/document-library.model';
|
||||
import { ContentActionModel } from './../models/content-action.model';
|
||||
@@ -60,7 +61,7 @@ export class DocumentList implements OnInit, AfterViewChecked, AfterContentInit
|
||||
name: 'Document Library',
|
||||
path: 'Sites/swsdp/documentLibrary'
|
||||
};
|
||||
currentFolderPath: string = 'swsdp/documentLibrary';
|
||||
currentFolderPath: string = 'Sites/swsdp/documentLibrary';
|
||||
folder: NodePaging;
|
||||
errorMessage;
|
||||
|
||||
@@ -152,7 +153,7 @@ export class DocumentList implements OnInit, AfterViewChecked, AfterContentInit
|
||||
});
|
||||
|
||||
if (this.navigate && item) {
|
||||
if (item.entry.isFolder) {
|
||||
if (item.entry && item.entry.isFolder) {
|
||||
let path = this.getNodePath(item);
|
||||
|
||||
this.folderClick.emit({
|
||||
|
@@ -21,8 +21,8 @@ import {
|
||||
expect,
|
||||
beforeEach
|
||||
} from 'angular2/testing';
|
||||
import {ContentActionHandler} from '../../src/models/content-action.model';
|
||||
import {DocumentActionsService} from '../../src/services/document-actions.service';
|
||||
import {ContentActionHandler} from '../models/content-action.model';
|
||||
import {DocumentActionsService} from './document-actions.service';
|
||||
import {AlfrescoServiceMock} from '../assets/alfresco.service.mock';
|
||||
|
||||
describe('DocumentActionsService', () => {
|
||||
|
@@ -21,8 +21,8 @@ import {
|
||||
expect,
|
||||
beforeEach
|
||||
} from 'angular2/testing';
|
||||
import {FolderActionsService} from '../../src/services/folder-actions.service';
|
||||
import {ContentActionHandler} from '../../src/models/content-action.model';
|
||||
import {FolderActionsService} from './folder-actions.service';
|
||||
import {ContentActionHandler} from '../models/content-action.model';
|
||||
|
||||
describe('FolderActionsService', () => {
|
||||
|
||||
|
Reference in New Issue
Block a user