mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Improved ESLint configuration, integrated spellcheck and error fixes (#8931)
* integrate cspell with eslint, improved configuration * core: fix linting errors * core: fix lint warnings * content: lint fixes * process service lint fixes * lint: process services cloud * lint: insights * lint: extensions * [ci:force] lint: cli fixes * [ci:force] comment out dead code * [ci:force] exclude dead code * fix code and tests * rollback some changes * fix testing lib * fix demo shell * minor lint warning fixes * minor lint fixes * fix process services
This commit is contained in:
@@ -454,7 +454,7 @@ describe('FormComponent', () => {
|
||||
});
|
||||
|
||||
it('should fetch and parse form by task id', (done) => {
|
||||
spyOn(taskService, 'getTask').and.returnValue(of(<TaskRepresentation>{}));
|
||||
spyOn(taskService, 'getTask').and.returnValue(of({} as TaskRepresentation));
|
||||
spyOn(taskFormService, 'getTaskForm').and.callFake((currentTaskId) => new Observable((observer) => {
|
||||
observer.next({taskId: currentTaskId});
|
||||
observer.complete();
|
||||
@@ -475,25 +475,25 @@ describe('FormComponent', () => {
|
||||
it('should handle error when getting form by task id', (done) => {
|
||||
const error = 'Some error';
|
||||
|
||||
spyOn(taskService, 'getTask').and.returnValue(of(<TaskRepresentation>{}));
|
||||
spyOn(taskService, 'getTask').and.returnValue(of({} as TaskRepresentation));
|
||||
spyOn(formComponent, 'handleError').and.stub();
|
||||
spyOn(taskFormService, 'getTaskForm').and.callFake(() => throwError(error));
|
||||
|
||||
formComponent.getFormByTaskId('123').then((_) => {
|
||||
formComponent.getFormByTaskId('123').then(() => {
|
||||
expect(formComponent.handleError).toHaveBeenCalledWith(error);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('should apply readonly state when getting form by task id', (done) => {
|
||||
spyOn(taskService, 'getTask').and.returnValue(of(<TaskRepresentation>{}));
|
||||
spyOn(taskService, 'getTask').and.returnValue(of({} as TaskRepresentation));
|
||||
spyOn(taskFormService, 'getTaskForm').and.callFake((taskId) => new Observable((observer) => {
|
||||
observer.next({taskId});
|
||||
observer.complete();
|
||||
}));
|
||||
|
||||
formComponent.readOnly = true;
|
||||
formComponent.getFormByTaskId('123').then((_) => {
|
||||
formComponent.getFormByTaskId('123').then(() => {
|
||||
expect(formComponent.form).toBeDefined();
|
||||
expect(formComponent.form.readOnly).toBe(true);
|
||||
done();
|
||||
|
@@ -22,9 +22,11 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
|
||||
import {
|
||||
formDefinitionDropdownField, formDefinitionTwoTextFields,
|
||||
formDefinitionDropdownField,
|
||||
formDefinitionTwoTextFields,
|
||||
formDefinitionRequiredField,
|
||||
formDefVisibilitiFieldDependsOnNextOne, formDefVisibilitiFieldDependsOnPreviousOne,
|
||||
formDefVisibilityFieldDependsOnNextOne,
|
||||
formDefVisibilitiFieldDependsOnPreviousOne,
|
||||
formReadonlyTwoTextFields
|
||||
} from '@alfresco/adf-core';
|
||||
import { FormComponent } from './form.component';
|
||||
@@ -47,10 +49,7 @@ describe('FormComponent UI and visibility', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
ProcessTestingModule
|
||||
],
|
||||
imports: [TranslateModule.forRoot(), ProcessTestingModule],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
});
|
||||
fixture = TestBed.createComponent(FormComponent);
|
||||
@@ -64,13 +63,12 @@ describe('FormComponent UI and visibility', () => {
|
||||
});
|
||||
|
||||
describe('Validation icon', () => {
|
||||
|
||||
it('should display valid icon for valid form', () => {
|
||||
spyOn(taskService, 'getTask').and.returnValue(of(<TaskRepresentation>{}));
|
||||
spyOn(taskService, 'getTask').and.returnValue(of({} as TaskRepresentation));
|
||||
spyOn(taskFormService, 'getTaskForm').and.returnValue(of(formDefinitionTwoTextFields));
|
||||
|
||||
const change = new SimpleChange(null, 1, true);
|
||||
component.ngOnChanges({taskId: change});
|
||||
component.ngOnChanges({ taskId: change });
|
||||
fixture.detectChanges();
|
||||
expect(fixture.debugElement.query(By.css('#adf-valid-form-icon'))).toBeDefined();
|
||||
expect(fixture.debugElement.query(By.css('#adf-valid-form-icon'))).not.toBeNull();
|
||||
@@ -78,11 +76,11 @@ describe('FormComponent UI and visibility', () => {
|
||||
});
|
||||
|
||||
it('should display invalid icon for valid form', () => {
|
||||
spyOn(taskService, 'getTask').and.returnValue(of(<TaskRepresentation>{}));
|
||||
spyOn(taskService, 'getTask').and.returnValue(of({} as TaskRepresentation));
|
||||
spyOn(taskFormService, 'getTaskForm').and.returnValue(of(formDefinitionRequiredField));
|
||||
|
||||
const change = new SimpleChange(null, 1, true);
|
||||
component.ngOnChanges({taskId: change});
|
||||
component.ngOnChanges({ taskId: change });
|
||||
fixture.detectChanges();
|
||||
expect(fixture.debugElement.query(By.css('#adf-valid-form-icon'))).toBeNull();
|
||||
expect(fixture.debugElement.query(By.css('#adf-invalid-form-icon'))).toBeDefined();
|
||||
@@ -90,11 +88,11 @@ describe('FormComponent UI and visibility', () => {
|
||||
});
|
||||
|
||||
it('should NOT display validation icon when [showValidationIcon] is false', () => {
|
||||
spyOn(taskService, 'getTask').and.returnValue(of(<TaskRepresentation>{}));
|
||||
spyOn(taskService, 'getTask').and.returnValue(of({} as TaskRepresentation));
|
||||
spyOn(taskFormService, 'getTaskForm').and.returnValue(of(formDefinitionTwoTextFields));
|
||||
|
||||
const change = new SimpleChange(null, 1, true);
|
||||
component.ngOnChanges({taskId: change});
|
||||
component.ngOnChanges({ taskId: change });
|
||||
component.showValidationIcon = false;
|
||||
fixture.detectChanges();
|
||||
expect(fixture.debugElement.query(By.css('#adf-valid-form-icon'))).toBeNull();
|
||||
@@ -103,13 +101,12 @@ describe('FormComponent UI and visibility', () => {
|
||||
});
|
||||
|
||||
describe('form definition', () => {
|
||||
|
||||
it('should display two text fields form definition', () => {
|
||||
spyOn(taskService, 'getTask').and.returnValue(of(<TaskRepresentation>{}));
|
||||
spyOn(taskService, 'getTask').and.returnValue(of({} as TaskRepresentation));
|
||||
spyOn(taskFormService, 'getTaskForm').and.returnValue(of(formDefinitionTwoTextFields));
|
||||
|
||||
const change = new SimpleChange(null, 1, true);
|
||||
component.ngOnChanges({taskId: change});
|
||||
component.ngOnChanges({ taskId: change });
|
||||
fixture.detectChanges();
|
||||
|
||||
const firstNameEl = fixture.debugElement.query(By.css('#firstname'));
|
||||
@@ -122,11 +119,11 @@ describe('FormComponent UI and visibility', () => {
|
||||
});
|
||||
|
||||
it('should display dropdown field', async () => {
|
||||
spyOn(taskService, 'getTask').and.returnValue(of(<TaskRepresentation>{}));
|
||||
spyOn(taskService, 'getTask').and.returnValue(of({} as TaskRepresentation));
|
||||
spyOn(taskFormService, 'getTaskForm').and.returnValue(of(formDefinitionDropdownField));
|
||||
|
||||
const change = new SimpleChange(null, 1, true);
|
||||
component.ngOnChanges({taskId: change});
|
||||
component.ngOnChanges({ taskId: change });
|
||||
fixture.detectChanges();
|
||||
await fixture.whenStable();
|
||||
|
||||
@@ -154,13 +151,12 @@ describe('FormComponent UI and visibility', () => {
|
||||
});
|
||||
|
||||
describe('Visibility conditions', () => {
|
||||
|
||||
it('should hide the field based on the next one', () => {
|
||||
spyOn(taskService, 'getTask').and.returnValue(of(<TaskRepresentation>{}));
|
||||
spyOn(taskFormService, 'getTaskForm').and.returnValue(of(formDefVisibilitiFieldDependsOnNextOne));
|
||||
spyOn(taskService, 'getTask').and.returnValue(of({} as TaskRepresentation));
|
||||
spyOn(taskFormService, 'getTaskForm').and.returnValue(of(formDefVisibilityFieldDependsOnNextOne));
|
||||
|
||||
const change = new SimpleChange(null, 1, true);
|
||||
component.ngOnChanges({taskId: change});
|
||||
component.ngOnChanges({ taskId: change });
|
||||
fixture.detectChanges();
|
||||
|
||||
const firstEl = fixture.debugElement.query(By.css('#field-country-container'));
|
||||
@@ -173,11 +169,11 @@ describe('FormComponent UI and visibility', () => {
|
||||
});
|
||||
|
||||
it('should hide the field based on the previous one', () => {
|
||||
spyOn(taskService, 'getTask').and.returnValue(of(<TaskRepresentation>{}));
|
||||
spyOn(taskService, 'getTask').and.returnValue(of({} as TaskRepresentation));
|
||||
spyOn(taskFormService, 'getTaskForm').and.returnValue(of(formDefVisibilitiFieldDependsOnPreviousOne));
|
||||
|
||||
const change = new SimpleChange(null, 1, true);
|
||||
component.ngOnChanges({taskId: change});
|
||||
component.ngOnChanges({ taskId: change });
|
||||
fixture.detectChanges();
|
||||
|
||||
const firstEl = fixture.debugElement.query(By.css('#name'));
|
||||
@@ -190,11 +186,11 @@ describe('FormComponent UI and visibility', () => {
|
||||
});
|
||||
|
||||
it('should show the hidden field when the visibility condition change to true', () => {
|
||||
spyOn(taskService, 'getTask').and.returnValue(of(<TaskRepresentation>{}));
|
||||
spyOn(taskFormService, 'getTaskForm').and.returnValue(of(formDefVisibilitiFieldDependsOnNextOne));
|
||||
spyOn(taskService, 'getTask').and.returnValue(of({} as TaskRepresentation));
|
||||
spyOn(taskFormService, 'getTaskForm').and.returnValue(of(formDefVisibilityFieldDependsOnNextOne));
|
||||
|
||||
const change = new SimpleChange(null, 1, true);
|
||||
component.ngOnChanges({taskId: change});
|
||||
component.ngOnChanges({ taskId: change });
|
||||
fixture.detectChanges();
|
||||
|
||||
let firstEl = fixture.debugElement.query(By.css('#field-country-container'));
|
||||
@@ -215,11 +211,11 @@ describe('FormComponent UI and visibility', () => {
|
||||
|
||||
describe('Readonly Form', () => {
|
||||
it('should display two text fields readonly', async () => {
|
||||
spyOn(taskService, 'getTask').and.returnValue(of(<TaskRepresentation>{}));
|
||||
spyOn(taskService, 'getTask').and.returnValue(of({} as TaskRepresentation));
|
||||
spyOn(taskFormService, 'getTaskForm').and.returnValue(of(formReadonlyTwoTextFields));
|
||||
|
||||
const change = new SimpleChange(null, 1, true);
|
||||
component.ngOnChanges({taskId: change});
|
||||
component.ngOnChanges({ taskId: change });
|
||||
|
||||
fixture.detectChanges();
|
||||
await fixture.whenStable();
|
||||
|
@@ -1195,7 +1195,7 @@ export const preselectedSingleNode = {
|
||||
]
|
||||
};
|
||||
|
||||
export const preselectedMultipleeNode = {
|
||||
export const preselectedMultipleNodes = {
|
||||
'fake-multiple-upload': [
|
||||
{
|
||||
id: 1027,
|
||||
|
@@ -22,7 +22,7 @@ import {
|
||||
startFormDateWidgetMock, startFormDropdownDefinitionMock,
|
||||
startFormTextDefinitionMock, startMockForm, startMockFormWithTab,
|
||||
startFormAmountWidgetMock, startFormNumberWidgetMock, startFormRadioButtonWidgetMock,
|
||||
taskFormSingleUploadMock, taskFormMultipleUploadMock, preselectedSingleNode, preselectedMultipleeNode
|
||||
taskFormSingleUploadMock, taskFormMultipleUploadMock, preselectedSingleNode, preselectedMultipleNodes
|
||||
} from './start-form.component.mock';
|
||||
import { StartFormComponent } from './start-form.component';
|
||||
import { WidgetVisibilityService, FormModel, FormOutcomeModel } from '@alfresco/adf-core';
|
||||
@@ -106,12 +106,12 @@ describe('StartFormComponent', () => {
|
||||
|
||||
it('should be able to inject multiple files as value into the form with an upload multiple widget', () => {
|
||||
getStartFormSpy.and.returnValue(of(taskFormMultipleUploadMock));
|
||||
component.data = preselectedMultipleeNode;
|
||||
component.data = preselectedMultipleNodes;
|
||||
component.ngOnChanges({ processDefinitionId: new SimpleChange(exampleId1, exampleId1, true) });
|
||||
|
||||
expect(component.form.getFieldById('fake-multiple-upload').value).toBeDefined();
|
||||
expect(component.form.getFieldById('fake-multiple-upload').value.length).toBe(2);
|
||||
expect(component.form.getFieldById('fake-multiple-upload').value).toBe(preselectedMultipleeNode['fake-multiple-upload']);
|
||||
expect(component.form.getFieldById('fake-multiple-upload').value).toBe(preselectedMultipleNodes['fake-multiple-upload']);
|
||||
});
|
||||
|
||||
it('should show outcome buttons by default', () => {
|
||||
|
@@ -79,7 +79,7 @@ export class PeopleComponent {
|
||||
}
|
||||
|
||||
involveUser(user: UserProcessModel) {
|
||||
if (user && user.id) {
|
||||
if (user?.id) {
|
||||
this.peopleProcessService
|
||||
.involveUserWithTask(this.taskId, user.id.toString())
|
||||
.subscribe(
|
||||
@@ -116,7 +116,7 @@ export class PeopleComponent {
|
||||
}
|
||||
|
||||
onClickAction(event: UserEventModel) {
|
||||
if (event && event.value && event.type === 'remove') {
|
||||
if (event?.value && event.type === 'remove') {
|
||||
this.removeInvolvedUser(event.value);
|
||||
}
|
||||
}
|
||||
|
@@ -147,6 +147,7 @@ describe('ProcessAuditDirective', () => {
|
||||
const auditJson = {
|
||||
processInstanceId: 42516, processInstanceName: 'Fake Process - August 3rd 2017',
|
||||
processDefinitionName: 'Claim Approval Process', processDefinitionVersion: 1, processInstanceStartTime: 'Thu Aug 03 15:32:47 UTC 2017', processInstanceEndTime: null,
|
||||
// eslint-disable-next-line @cspell/spellchecker
|
||||
processInstanceDurationInMillis: null,
|
||||
processInstanceInitiator: 'MyName MyLastname',
|
||||
entries: [{
|
||||
@@ -156,6 +157,7 @@ describe('ProcessAuditDirective', () => {
|
||||
fieldId: 'username', value: 'dsassd'
|
||||
},
|
||||
{ fieldName: 'Claim Amount', fieldId: 'claimamount', value: '22' }], taskName: null, taskAssignee: null, activityId: null,
|
||||
// eslint-disable-next-line @cspell/spellchecker
|
||||
activityName: null, activityType: null, startTime: null, endTime: null, durationInMillis: null
|
||||
}
|
||||
], decisionInfo: { calculatedValues: [], appliedRules: [] }
|
||||
|
@@ -42,7 +42,7 @@ describe('ProcessInstanceListComponent', () => {
|
||||
let getProcessInstancesSpy: jasmine.Spy;
|
||||
let appConfig: AppConfigService;
|
||||
|
||||
const resolverfn = (row: DataRow, col: DataColumn) => {
|
||||
const resolverFn = (row: DataRow, col: DataColumn) => {
|
||||
const value = row.getValue(col.key);
|
||||
if (col.key === 'variables') {
|
||||
return (value || []).map((processVar) => `${processVar.name} - ${processVar.value}`).toString();
|
||||
@@ -293,7 +293,7 @@ describe('ProcessInstanceListComponent', () => {
|
||||
}
|
||||
};
|
||||
component.presetColumn = 'fakeProcessCustomSchema';
|
||||
component.resolverFn = resolverfn;
|
||||
component.resolverFn = resolverFn;
|
||||
component.reload();
|
||||
|
||||
fixture.detectChanges();
|
||||
@@ -458,7 +458,7 @@ describe('ProcessInstanceListComponent', () => {
|
||||
|
||||
@Component({
|
||||
template: `
|
||||
<adf-process-instance-list #processlistComponentInstance>
|
||||
<adf-process-instance-list #processListComponentInstance>
|
||||
<data-columns>
|
||||
<data-column key="name" title="ADF_PROCESS_LIST.PROPERTIES.NAME" class="adf-full-width adf-name-column"></data-column>
|
||||
<data-column key="created" title="ADF_PROCESS_LIST.PROPERTIES.END_DATE" class="adf-hidden"></data-column>
|
||||
@@ -554,7 +554,7 @@ describe('Process List: Custom EmptyTemplateComponent', () => {
|
||||
[appId]="appId"
|
||||
[showContextMenu]="true"
|
||||
(showRowContextMenu)="onShowRowContextMenu($event)"
|
||||
#processlistComponentInstance>
|
||||
#processListComponentInstance>
|
||||
<data-columns>
|
||||
<data-column key="name" title="ADF_PROCESS_LIST.PROPERTIES.NAME" class="adf-full-width adf-name-column"></data-column>
|
||||
<data-column key="created" title="ADF_PROCESS_LIST.PROPERTIES.END_DATE" class="adf-hidden"></data-column>
|
||||
|
@@ -329,7 +329,7 @@ export class StartProcessInstanceComponent implements OnChanges, OnInit, OnDestr
|
||||
const accountIdentifier = this.getAlfrescoRepositoryName();
|
||||
|
||||
for (const key in this.values) {
|
||||
if (this.values.hasOwnProperty(key)) {
|
||||
if (Object.prototype.hasOwnProperty.call(this.values, key)) {
|
||||
const currentValue = Array.isArray(this.values[key]) ? this.values[key] : [this.values[key]];
|
||||
const contents = currentValue
|
||||
.filter((value: any) => !!value?.isFile)
|
||||
|
@@ -212,7 +212,7 @@ describe('Process filter', () => {
|
||||
describe('add filter', () => {
|
||||
beforeEach(() => {
|
||||
createFilter = spyOn(service['userFiltersApi'], 'createUserProcessInstanceFilter').and.callFake(
|
||||
(processfilter: FilterProcessRepresentationModel) => Promise.resolve(processfilter)
|
||||
(processFilter) => Promise.resolve(processFilter)
|
||||
);
|
||||
});
|
||||
|
||||
|
@@ -84,7 +84,7 @@ describe('TaskDetailsComponent', () => {
|
||||
logService = TestBed.inject(LogService);
|
||||
peopleProcessService = TestBed.inject(PeopleProcessService);
|
||||
|
||||
spyOn(peopleProcessService, 'getCurrentUserInfo').and.returnValue(of(<any>{ email: 'fake-email' }));
|
||||
spyOn(peopleProcessService, 'getCurrentUserInfo').and.returnValue(of({ email: 'fake-email' } as any));
|
||||
|
||||
taskListService = TestBed.inject(TaskListService);
|
||||
spyOn(taskListService, 'getTaskChecklist').and.returnValue(of(noDataMock));
|
||||
|
@@ -83,7 +83,7 @@ describe('TaskFormComponent', () => {
|
||||
taskDetailsMock.processDefinitionId = null;
|
||||
spyOn(taskService, 'getTask').and.returnValue(of(taskDetailsMock));
|
||||
peopleProcessService = TestBed.inject(PeopleProcessService);
|
||||
getBpmLoggedUserSpy = spyOn(peopleProcessService, 'getCurrentUserInfo').and.returnValue(of(<any>fakeUser));
|
||||
getBpmLoggedUserSpy = spyOn(peopleProcessService, 'getCurrentUserInfo').and.returnValue(of(fakeUser as any));
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
@@ -106,11 +106,11 @@ describe('TaskFormComponent', () => {
|
||||
getTaskDetailsSpy.and.returnValue(of(taskDetailsMock));
|
||||
fixture.detectChanges();
|
||||
await fixture.whenStable();
|
||||
const activitFormSelector = element.querySelector('adf-form');
|
||||
const formSelector = element.querySelector('adf-form');
|
||||
const inputFieldOne = fixture.debugElement.nativeElement.querySelector('#text1');
|
||||
const inputFieldTwo = fixture.debugElement.nativeElement.querySelector('#text2');
|
||||
const inputFieldThree = fixture.debugElement.nativeElement.querySelector('#text3');
|
||||
expect(activitFormSelector).toBeDefined();
|
||||
expect(formSelector).toBeDefined();
|
||||
expect(inputFieldOne['disabled']).toEqual(false);
|
||||
expect(inputFieldTwo['disabled']).toEqual(false);
|
||||
expect(inputFieldThree['disabled']).toEqual(false);
|
||||
@@ -144,9 +144,9 @@ describe('TaskFormComponent', () => {
|
||||
component.taskId = '123';
|
||||
fixture.detectChanges();
|
||||
await fixture.whenStable();
|
||||
const activitFormSelector = element.querySelector('adf-form');
|
||||
const formSelector = element.querySelector('adf-form');
|
||||
const completeButton = fixture.debugElement.nativeElement.querySelector('#adf-form-complete');
|
||||
expect(activitFormSelector).toBeDefined();
|
||||
expect(formSelector).toBeDefined();
|
||||
expect(completeButton['disabled']).toEqual(false);
|
||||
completeButton.click();
|
||||
expect(completeTaskFormSpy).toHaveBeenCalled();
|
||||
@@ -192,11 +192,11 @@ describe('TaskFormComponent', () => {
|
||||
getTaskDetailsSpy.and.returnValue(of(claimableTaskDetailsMock));
|
||||
fixture.detectChanges();
|
||||
await fixture.whenStable();
|
||||
const activitFormSelector = element.querySelector('adf-form');
|
||||
const formSelector = element.querySelector('adf-form');
|
||||
const inputFieldOne = fixture.debugElement.nativeElement.querySelector('#text1');
|
||||
const inputFieldTwo = fixture.debugElement.nativeElement.querySelector('#text2');
|
||||
const inputFieldThree = fixture.debugElement.nativeElement.querySelector('#text3');
|
||||
expect(activitFormSelector).toBeDefined();
|
||||
expect(formSelector).toBeDefined();
|
||||
expect(inputFieldOne['disabled']).toEqual(true);
|
||||
expect(inputFieldTwo['disabled']).toEqual(true);
|
||||
expect(inputFieldThree['disabled']).toEqual(true);
|
||||
@@ -271,11 +271,11 @@ describe('TaskFormComponent', () => {
|
||||
getTaskDetailsSpy.and.returnValue(of(completedTaskDetailsMock));
|
||||
fixture.detectChanges();
|
||||
await fixture.whenStable();
|
||||
const activitFormSelector = element.querySelector('adf-form');
|
||||
const formSelector = element.querySelector('adf-form');
|
||||
const inputFieldOne = fixture.debugElement.nativeElement.querySelector('#text1');
|
||||
const inputFieldTwo = fixture.debugElement.nativeElement.querySelector('#text2');
|
||||
const inputFieldThree = fixture.debugElement.nativeElement.querySelector('#text3');
|
||||
expect(activitFormSelector).toBeDefined();
|
||||
expect(formSelector).toBeDefined();
|
||||
expect(inputFieldOne['disabled']).toEqual(true);
|
||||
expect(inputFieldTwo['disabled']).toEqual(true);
|
||||
expect(inputFieldThree['disabled']).toEqual(true);
|
||||
@@ -352,9 +352,9 @@ describe('TaskFormComponent', () => {
|
||||
component.taskDetails = new TaskDetailsModel(taskDetailsWithOutFormMock);
|
||||
fixture.detectChanges();
|
||||
await fixture.whenStable();
|
||||
const activitFormSelector = element.querySelector('adf-form');
|
||||
const formSelector = element.querySelector('adf-form');
|
||||
const completeButtonElement = fixture.debugElement.nativeElement.querySelector('#adf-no-form-complete-button');
|
||||
expect(activitFormSelector).toBeDefined();
|
||||
expect(formSelector).toBeDefined();
|
||||
expect(completeButtonElement['disabled']).toEqual(false);
|
||||
completeButtonElement.click();
|
||||
expect(errorSpy).toHaveBeenCalled();
|
||||
@@ -592,10 +592,10 @@ describe('TaskFormComponent', () => {
|
||||
fixture.detectChanges();
|
||||
await fixture.whenStable();
|
||||
|
||||
const activitFormSelector = element.querySelector('adf-form');
|
||||
const formSelector = element.querySelector('adf-form');
|
||||
const completeButton = fixture.debugElement.nativeElement.querySelector('#adf-form-complete');
|
||||
|
||||
expect(activitFormSelector).toBeDefined();
|
||||
expect(formSelector).toBeDefined();
|
||||
expect(completeButton['disabled']).toEqual(false);
|
||||
expect(component.isProcessInitiator()).toEqual(true);
|
||||
|
||||
@@ -616,10 +616,10 @@ describe('TaskFormComponent', () => {
|
||||
expect(component.isProcessInitiator()).toEqual(true);
|
||||
expect(component.isCandidateMember()).toEqual(true);
|
||||
|
||||
const activitFormSelector = element.querySelector('adf-form');
|
||||
const formSelector = element.querySelector('adf-form');
|
||||
const completeButton = fixture.debugElement.nativeElement.querySelector('#adf-form-complete');
|
||||
|
||||
expect(activitFormSelector).toBeDefined();
|
||||
expect(formSelector).toBeDefined();
|
||||
expect(completeButton['disabled']).toEqual(true);
|
||||
});
|
||||
|
||||
@@ -638,10 +638,10 @@ describe('TaskFormComponent', () => {
|
||||
fixture.detectChanges();
|
||||
await fixture.whenStable();
|
||||
|
||||
const activitFormSelector = element.querySelector('adf-form');
|
||||
const formSelector = element.querySelector('adf-form');
|
||||
const completeButton = fixture.debugElement.nativeElement.querySelector('#adf-form-complete');
|
||||
|
||||
expect(activitFormSelector).toBeDefined();
|
||||
expect(formSelector).toBeDefined();
|
||||
expect(component.canInitiatorComplete()).toEqual(false);
|
||||
expect(component.isProcessInitiator()).toEqual(false);
|
||||
expect(completeButton['disabled']).toEqual(false);
|
||||
@@ -824,10 +824,10 @@ describe('TaskFormComponent', () => {
|
||||
getTaskDetailsSpy.and.returnValue(of(involvedUserTaskForm));
|
||||
fixture.detectChanges();
|
||||
await fixture.whenStable();
|
||||
const activitFormSelector = element.querySelector('adf-form');
|
||||
const formSelector = element.querySelector('adf-form');
|
||||
const saveButton = fixture.debugElement.nativeElement.querySelector('[id="adf-form-save"]');
|
||||
const completeButton = fixture.debugElement.nativeElement.querySelector('[id="adf-form-complete"]');
|
||||
expect(activitFormSelector).toBeDefined();
|
||||
expect(formSelector).toBeDefined();
|
||||
expect(saveButton.disabled).toEqual(false);
|
||||
expect(completeButton.disabled).toEqual(true);
|
||||
});
|
||||
@@ -845,10 +845,10 @@ describe('TaskFormComponent', () => {
|
||||
getTaskDetailsSpy.and.returnValue(of(involvedGroupTaskForm));
|
||||
fixture.detectChanges();
|
||||
await fixture.whenStable();
|
||||
const activitFormSelector = element.querySelector('adf-form');
|
||||
const formSelector = element.querySelector('adf-form');
|
||||
const saveButton = fixture.debugElement.nativeElement.querySelector('[id="adf-form-save"]');
|
||||
const completeButton = fixture.debugElement.nativeElement.querySelector('[id="adf-form-complete"]');
|
||||
expect(activitFormSelector).toBeDefined();
|
||||
expect(formSelector).toBeDefined();
|
||||
expect(saveButton.disabled).toEqual(false);
|
||||
expect(completeButton.disabled).toEqual(true);
|
||||
saveButton.click();
|
||||
@@ -869,11 +869,11 @@ describe('TaskFormComponent', () => {
|
||||
await fixture.whenStable();
|
||||
fixture.detectChanges();
|
||||
|
||||
const activitFormSelector = element.querySelector('adf-form');
|
||||
const formSelector = element.querySelector('adf-form');
|
||||
const inputFieldOne = fixture.debugElement.nativeElement.querySelector('#text1');
|
||||
const inputFieldTwo = fixture.debugElement.nativeElement.querySelector('#text2');
|
||||
const inputFieldThree = fixture.debugElement.nativeElement.querySelector('#text3');
|
||||
expect(activitFormSelector).toBeDefined();
|
||||
expect(formSelector).toBeDefined();
|
||||
expect(inputFieldOne['disabled']).toEqual(true, 'Task Form field is enabled');
|
||||
expect(inputFieldTwo['disabled']).toEqual(true, 'Task Form field is enabled');
|
||||
expect(inputFieldThree['disabled']).toEqual(true, 'Task Form field is enabled');
|
||||
@@ -889,11 +889,11 @@ describe('TaskFormComponent', () => {
|
||||
await fixture.whenStable();
|
||||
fixture.detectChanges();
|
||||
|
||||
const activitFormSelector = element.querySelector('adf-form');
|
||||
const formSelector = element.querySelector('adf-form');
|
||||
const inputFieldOne = fixture.debugElement.nativeElement.querySelector('#text1');
|
||||
const inputFieldTwo = fixture.debugElement.nativeElement.querySelector('#text2');
|
||||
const inputFieldThree = fixture.debugElement.nativeElement.querySelector('#text3');
|
||||
expect(activitFormSelector).toBeDefined();
|
||||
expect(formSelector).toBeDefined();
|
||||
expect(inputFieldOne['disabled']).toEqual(true, 'Task Form field is enabled');
|
||||
expect(inputFieldTwo['disabled']).toEqual(true, 'Task Form field is enabled');
|
||||
expect(inputFieldThree['disabled']).toEqual(true, 'Task Form field is enabled');
|
||||
@@ -908,12 +908,12 @@ describe('TaskFormComponent', () => {
|
||||
await fixture.whenStable();
|
||||
fixture.detectChanges();
|
||||
|
||||
const activitFormSelector = element.querySelector('adf-form');
|
||||
const formSelector = element.querySelector('adf-form');
|
||||
const inputFieldOne = fixture.debugElement.nativeElement.querySelector('#text1');
|
||||
const inputFieldTwo = fixture.debugElement.nativeElement.querySelector('#text2');
|
||||
const inputFieldThree = fixture.debugElement.nativeElement.querySelector('#text3');
|
||||
|
||||
expect(activitFormSelector).toBeDefined();
|
||||
expect(formSelector).toBeDefined();
|
||||
expect(inputFieldOne['disabled']).toEqual(true);
|
||||
expect(inputFieldTwo['disabled']).toEqual(true);
|
||||
expect(inputFieldThree['disabled']).toEqual(true);
|
||||
@@ -929,12 +929,12 @@ describe('TaskFormComponent', () => {
|
||||
await fixture.whenStable();
|
||||
fixture.detectChanges();
|
||||
|
||||
const activitFormSelector = element.querySelector('adf-form');
|
||||
const formSelector = element.querySelector('adf-form');
|
||||
const inputFieldOne = fixture.debugElement.nativeElement.querySelector('#text1');
|
||||
const inputFieldTwo = fixture.debugElement.nativeElement.querySelector('#text2');
|
||||
const inputFieldThree = fixture.debugElement.nativeElement.querySelector('#text3');
|
||||
|
||||
expect(activitFormSelector).toBeDefined();
|
||||
expect(formSelector).toBeDefined();
|
||||
expect(inputFieldOne['disabled']).toEqual(false, 'Task Form field is disabled');
|
||||
expect(inputFieldTwo['disabled']).toEqual(false, 'Task Form field is disabled');
|
||||
expect(inputFieldThree['disabled']).toEqual(false, 'Task Form field is disabled');
|
||||
|
@@ -214,7 +214,7 @@ export class TaskFormComponent implements OnInit, OnChanges {
|
||||
}
|
||||
|
||||
isStandaloneTask(): boolean {
|
||||
return !!!this.taskDetails?.processDefinitionId;
|
||||
return !this.taskDetails?.processDefinitionId;
|
||||
}
|
||||
|
||||
isTaskLoaded(): boolean {
|
||||
|
Reference in New Issue
Block a user