diff --git a/lib/core/form/components/widgets/tabs/tabs.widget.spec.ts b/lib/core/form/components/widgets/tabs/tabs.widget.spec.ts index 02482eb38f..ffd8ad0323 100644 --- a/lib/core/form/components/widgets/tabs/tabs.widget.spec.ts +++ b/lib/core/form/components/widgets/tabs/tabs.widget.spec.ts @@ -111,18 +111,18 @@ describe('TabsWidgetComponent', () => { fixture.detectChanges(); fixture.whenStable() .then(() => { - expect(element.querySelector('#title-tab-id-visible').innerHTML).toContain('tab-title-visible'); + expect(element.innerText).toContain('tab-title-visible'); }); }); - xit('should show tab when it became visible', async(() => { + it('should show tab when it became visible', async(() => { fixture.detectChanges(); tabWidgetComponent.formTabChanged.subscribe((res) => { tabWidgetComponent.tabs[1].isVisible = true; fixture.detectChanges(); fixture.whenStable() .then(() => { - expect(element.querySelector('#title-tab-id-invisible').innerHTML).toContain('tab-title-invisible'); + expect(element.innerText).toContain('tab-title-invisible'); }); }); tabWidgetComponent.tabChanged(null); @@ -135,8 +135,7 @@ describe('TabsWidgetComponent', () => { fixture.detectChanges(); fixture.whenStable() .then(() => { - expect(element.querySelector('#tab-id-visible')).toBeNull(); - expect(element.querySelector('#title-tab-id-visible')).toBeNull(); + expect(element.querySelector('innerText')).not.toContain('tab-title-visible'); }); }); tabWidgetComponent.tabChanged(null); diff --git a/lib/process-services/people/components/people/people.component.spec.ts b/lib/process-services/people/components/people/people.component.spec.ts index 361d3eca5e..dfe9850c66 100644 --- a/lib/process-services/people/components/people/people.component.spec.ts +++ b/lib/process-services/people/components/people/people.component.spec.ts @@ -176,7 +176,7 @@ describe('PeopleComponent', () => { }); }); - xit('should return an empty list for not valid search', (done) => { + it('should return an empty list for not valid search', (done) => { activitiPeopleComponent.peopleSearch$.subscribe((users) => { expect(users.length).toBe(0); done(); diff --git a/lib/process-services/task-list/components/checklist.component.spec.ts b/lib/process-services/task-list/components/checklist.component.spec.ts index 7d4d6d46a5..83844864d8 100644 --- a/lib/process-services/task-list/components/checklist.component.spec.ts +++ b/lib/process-services/task-list/components/checklist.component.spec.ts @@ -154,7 +154,7 @@ describe('ChecklistComponent', () => { expect(element.querySelector('#check-fake-check-id').textContent).toContain('fake-check-name'); }); - xit('should add checklist', async(() => { + it('should add checklist', async(() => { showChecklistDialog.click(); let addButtonDialog = window.document.querySelector('#add-check'); addButtonDialog.click(); diff --git a/lib/process-services/task-list/components/start-task.component.spec.ts b/lib/process-services/task-list/components/start-task.component.spec.ts index 825c84401d..acd0930fb0 100644 --- a/lib/process-services/task-list/components/start-task.component.spec.ts +++ b/lib/process-services/task-list/components/start-task.component.spec.ts @@ -334,7 +334,7 @@ describe('StartTaskComponent', () => { expect(testFullname4.trim()).toBe(''); }); - xit('should emit error when there is an error while creating task', () => { + it('should emit error when there is an error while creating task', () => { let errorSpy = spyOn(component.error, 'emit'); spyOn(service, 'createNewTask').and.returnValue(Observable.throw({})); let createTaskButton = element.querySelector('#button-start'); diff --git a/lib/process-services/task-list/components/task-list.component.spec.ts b/lib/process-services/task-list/components/task-list.component.spec.ts index 35beaa31d0..0df938f1d1 100644 --- a/lib/process-services/task-list/components/task-list.component.spec.ts +++ b/lib/process-services/task-list/components/task-list.component.spec.ts @@ -77,10 +77,6 @@ describe('TaskListComponent', () => { ] }; - let mockErrorTaskList = { - error: 'wrong request' - }; - let fakeCutomSchema = [ { 'key': 'fakeName', @@ -362,27 +358,6 @@ describe('TaskListComponent', () => { expect(dataRow[1].isSelected).toEqual(true); }); - xit('should throw an exception when the response is wrong', (done) => { - let state = new SimpleChange(null, 'open', true); - let assignment = new SimpleChange(null, 'fake-assignee', true); - - component.error.subscribe((err) => { - expect(err).toBeDefined(); - expect(err.error).toBe('wrong request'); - done(); - }); - - component.ngAfterContentInit(); - fixture.detectChanges(); - component.ngOnChanges({'state': state, 'assignment': assignment}); - - jasmine.Ajax.requests.mostRecent().respondWith({ - 'status': 404, - contentType: 'application/json', - responseText: JSON.stringify(mockErrorTaskList) - }); - }); - it('should reload tasks when reload() is called', (done) => { component.state = 'open'; component.assignment = 'fake-assignee'; diff --git a/lib/process-services/task-list/services/tasklist.service.spec.ts b/lib/process-services/task-list/services/tasklist.service.spec.ts index 7964829876..19fe4bc784 100644 --- a/lib/process-services/task-list/services/tasklist.service.spec.ts +++ b/lib/process-services/task-list/services/tasklist.service.spec.ts @@ -20,7 +20,6 @@ import { UserProcessModel } from '@alfresco/adf-core'; import { Observable } from 'rxjs/Observable'; import { fakeCompletedTaskList, - mockErrorTaskList, fakeFilter, fakeFormList, fakeOpenTaskList, @@ -98,21 +97,6 @@ describe('Activiti TaskList Service', () => { }); }); - it('should throw an exception when the response is wrong', (done) => { - service.getTasks( fakeFilter).subscribe((res) => { - }, - (err: any) => { - expect(err).toBeDefined(); - done(); - }); - - jasmine.Ajax.requests.mostRecent().respondWith({ - 'status': 404, - contentType: 'application/json', - responseText: JSON.stringify(mockErrorTaskList) - }); - }); - it('should return the task list with all tasks filtered by state', (done) => { spyOn(service, 'getTasks').and.returnValue(Observable.of(fakeTaskList)); spyOn(service, 'getTotalTasks').and.returnValue(Observable.of(fakeTaskList)); @@ -244,7 +228,7 @@ describe('Activiti TaskList Service', () => { }); }); - xit('should return the task details ', (done) => { + it('should return the task details ', (done) => { service.getTaskDetails('999').subscribe((res: TaskDetailsModel) => { expect(res).toBeDefined(); expect(res.id).toEqual('999'); @@ -264,7 +248,7 @@ describe('Activiti TaskList Service', () => { }); }); - xit('should return the tasks checklists ', (done) => { + it('should return the tasks checklists ', (done) => { service.getTaskChecklist('999').subscribe((res: TaskDetailsModel[]) => { expect(res).toBeDefined(); expect(res.length).toEqual(2); @@ -286,7 +270,7 @@ describe('Activiti TaskList Service', () => { }); }); - xit('should add a task ', (done) => { + it('should add a task ', (done) => { let taskFake = new TaskDetailsModel({ id: 123, parentTaskId: 456, @@ -316,7 +300,7 @@ describe('Activiti TaskList Service', () => { }); }); - xit('should remove a checklist task ', (done) => { + it('should remove a checklist task ', (done) => { service.deleteTask('999').subscribe(() => { done(); }); @@ -327,7 +311,7 @@ describe('Activiti TaskList Service', () => { }); }); - xit('should complete the task', (done) => { + it('should complete the task', (done) => { service.completeTask('999').subscribe((res: any) => { expect(res).toBeDefined(); done(); @@ -340,7 +324,7 @@ describe('Activiti TaskList Service', () => { }); }); - xit('should return the total number of tasks', (done) => { + it('should return the total number of tasks', (done) => { service.getTotalTasks( fakeFilter).subscribe((res: any) => { expect(res).toBeDefined(); expect(res.size).toEqual(1); @@ -355,7 +339,7 @@ describe('Activiti TaskList Service', () => { }); }); - xit('should create a new standalone task ', (done) => { + it('should create a new standalone task ', (done) => { let taskFake = new TaskDetailsModel({ name: 'FakeNameTask', description: 'FakeDescription', @@ -386,7 +370,7 @@ describe('Activiti TaskList Service', () => { }); }); - xit('should assign task to a user', (done) => { + it('should assign task to a user', (done) => { let testTaskId = '8888'; service.assignTask(testTaskId, fakeUser2).subscribe((res: TaskDetailsModel) => { expect(res).toBeDefined(); @@ -420,7 +404,7 @@ describe('Activiti TaskList Service', () => { }); }); - xit('should assign task to a userId', (done) => { + it('should assign task to a userId', (done) => { let testTaskId = '8888'; service.assignTaskByUserId(testTaskId, fakeUser2.id).subscribe((res: TaskDetailsModel) => { expect(res).toBeDefined(); @@ -452,7 +436,7 @@ describe('Activiti TaskList Service', () => { }); }); - xit('should claim a task', (done) => { + it('should claim a task', (done) => { let taskId = '111'; service.claimTask(taskId).subscribe(() => { @@ -466,7 +450,7 @@ describe('Activiti TaskList Service', () => { }); }); - xit('should unclaim a task', (done) => { + it('should unclaim a task', (done) => { let taskId = '111'; service.unclaimTask(taskId).subscribe(() => { @@ -480,7 +464,7 @@ describe('Activiti TaskList Service', () => { }); }); - xit('should update a task', (done) => { + it('should update a task', (done) => { let taskId = '111'; service.updateTask(taskId, { property: 'value' }).subscribe(() => { @@ -494,7 +478,7 @@ describe('Activiti TaskList Service', () => { }); }); - xit('should return the filter if it contains task id', (done) => { + it('should return the filter if it contains task id', (done) => { let taskId = '1'; let filterFake = new FilterRepresentationModel({ name: 'FakeNameFilter', @@ -520,7 +504,7 @@ describe('Activiti TaskList Service', () => { }); }); - xit('should return the filters if it contains task id', (done) => { + it('should return the filters if it contains task id', (done) => { let taskId = '1'; let fakeFilterList: FilterRepresentationModel[] = []; @@ -549,7 +533,7 @@ describe('Activiti TaskList Service', () => { }); }); - xit('should get possible form list', (done) => { + it('should get possible form list', (done) => { service.getFormList().subscribe((res: any) => { expect(res).toBeDefined(); expect(res.length).toBe(2);