Merge branch 'development' into dev-denys-1152

This commit is contained in:
Denys Vuika
2017-01-06 10:03:40 +00:00
committed by GitHub
6 changed files with 72 additions and 11 deletions

View File

@@ -21,7 +21,7 @@ import { Observable } from 'rxjs/Rx';
import { ActivitiProcessInstanceListComponent } from './activiti-processlist.component';
import { AlfrescoTranslateService, CoreModule } from 'ng2-alfresco-core';
import { DataTableModule, ObjectDataRow, DataRowEvent, ObjectDataTableAdapter } from 'ng2-alfresco-datatable';
import { DataTableModule, ObjectDataRow, DataRowEvent, ObjectDataTableAdapter, DataSorting } from 'ng2-alfresco-datatable';
import { TranslationMock } from './../assets/translation.service.mock';
import { ProcessInstance } from '../models/process-instance.model';
@@ -275,7 +275,7 @@ describe('ActivitiProcessInstanceListComponent', () => {
});
it('should reload the list when the sort parameter changes', (done) => {
const sort = 'desc';
const sort = 'created-desc';
let change = new SimpleChange(null, sort);
component.onSuccess.subscribe((res) => {
@@ -290,6 +290,21 @@ describe('ActivitiProcessInstanceListComponent', () => {
component.ngOnChanges({'sort': change});
});
it('should sort the list when the sort parameter changes', (done) => {
const sort = 'created-asc';
let change = new SimpleChange(null, sort);
let sortSpy = spyOn(component.data, 'setSorting');
component.onSuccess.subscribe((res) => {
expect(res).toBeDefined();
expect(sortSpy).toHaveBeenCalledWith(new DataSorting('started', 'asc'));
done();
});
component.sort = sort;
component.ngOnChanges({'sort': change});
});
it('should reload the process list when the name parameter changes', (done) => {
const name = 'FakeTaskName';
let change = new SimpleChange(null, name);