mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-26 17:24:56 +00:00
restore PS xit tests (#3173)
This commit is contained in:
parent
38de016893
commit
8b4af90b46
@ -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);
|
||||
|
@ -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();
|
||||
|
@ -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 = <HTMLElement> window.document.querySelector('#add-check');
|
||||
addButtonDialog.click();
|
||||
|
@ -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 = <HTMLElement> element.querySelector('#button-start');
|
||||
|
@ -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';
|
||||
|
@ -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(<TaskQueryRequestRepresentationModel> 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(<TaskQueryRequestRepresentationModel> 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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user