mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-08-07 17:48:54 +00:00
Unit tests for document list component
This commit is contained in:
@@ -41,9 +41,24 @@ describe('ContentColumnList', () => {
|
||||
it('should register column within parent document list', () => {
|
||||
expect(documentList.columns.length).toBe(0);
|
||||
|
||||
columnList.registerColumn(new ContentColumnModel());
|
||||
let result = columnList.registerColumn(new ContentColumnModel());
|
||||
|
||||
expect(result).toBeTruthy();
|
||||
expect(documentList.columns.length).toBe(1);
|
||||
});
|
||||
|
||||
it('should require document list instance to register action', () => {
|
||||
columnList = new ContentColumnList(null);
|
||||
let col = new ContentColumnModel();
|
||||
expect(columnList.registerColumn(col)).toBeFalsy();
|
||||
});
|
||||
|
||||
it('should require action instance to register', () => {
|
||||
spyOn(documentList.actions, 'push').and.callThrough();
|
||||
let result = columnList.registerColumn(null);
|
||||
|
||||
expect(result).toBeFalsy();
|
||||
expect(documentList.actions.push).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
});
|
||||
|
Reference in New Issue
Block a user