mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-5387] - Fix dropdown tests, remove call to external API (#7044)
* [ADF-5387] - Fix dropdown tests, remove call to external API * Update simpleapp * Re-include test * Fix comment * Fix lint errors
This commit is contained in:
@@ -63,7 +63,7 @@ describe('Form Field Component - Dropdown Widget', () => {
|
|||||||
await apiService.login(testUser.username, testUser.password);
|
await apiService.login(testUser.username, testUser.password);
|
||||||
|
|
||||||
const processDefinition = await processDefinitionService
|
const processDefinition = await processDefinitionService
|
||||||
.getProcessDefinitionByName(browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.processes.dropdownrestprocess, simpleApp);
|
.getProcessDefinitionByName(browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.processes.dropdownOptionsProcess, simpleApp);
|
||||||
|
|
||||||
await processInstancesService.createProcessInstance(processDefinition.entry.key, simpleApp);
|
await processInstancesService.createProcessInstance(processDefinition.entry.key, simpleApp);
|
||||||
|
|
||||||
@@ -87,7 +87,7 @@ describe('Form Field Component - Dropdown Widget', () => {
|
|||||||
await appListCloudComponent.goToApp(simpleApp);
|
await appListCloudComponent.goToApp(simpleApp);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('[C290069] Should be able to read rest service dropdown options, save and complete the task form', async () => {
|
it('[C309878] Should be able to select a dropdown option, save and complete the task form', async () => {
|
||||||
await taskFilter.clickTaskFilter('my-tasks');
|
await taskFilter.clickTaskFilter('my-tasks');
|
||||||
await taskList.getDataTable().waitTillContentLoaded();
|
await taskList.getDataTable().waitTillContentLoaded();
|
||||||
|
|
||||||
@@ -97,15 +97,15 @@ describe('Form Field Component - Dropdown Widget', () => {
|
|||||||
await taskHeaderCloudPage.checkTaskPropertyListIsDisplayed();
|
await taskHeaderCloudPage.checkTaskPropertyListIsDisplayed();
|
||||||
|
|
||||||
await taskFormCloudComponent.formFields().checkFormIsDisplayed();
|
await taskFormCloudComponent.formFields().checkFormIsDisplayed();
|
||||||
await taskFormCloudComponent.formFields().checkWidgetIsVisible('Dropdown097maj');
|
await taskFormCloudComponent.formFields().checkWidgetIsVisible('DropdownOptions');
|
||||||
await dropdown.selectOption('Clementine Bauch', 'dropdown-cloud-widget mat-select');
|
await dropdown.selectOption('option2', 'dropdown-cloud-widget mat-select');
|
||||||
|
|
||||||
await expect(await dropdown.getSelectedOptionText('Dropdown097maj')).toBe('Clementine Bauch');
|
await expect(await dropdown.getSelectedOptionText('DropdownOptions')).toBe('option2');
|
||||||
|
|
||||||
await taskFormCloudComponent.checkSaveButtonIsDisplayed();
|
await taskFormCloudComponent.checkSaveButtonIsDisplayed();
|
||||||
await taskFormCloudComponent.clickSaveButton();
|
await taskFormCloudComponent.clickSaveButton();
|
||||||
|
|
||||||
await expect(await dropdown.getSelectedOptionText('Dropdown097maj')).toBe('Clementine Bauch');
|
await expect(await dropdown.getSelectedOptionText('DropdownOptions')).toBe('option2');
|
||||||
|
|
||||||
await taskFormCloudComponent.checkCompleteButtonIsDisplayed();
|
await taskFormCloudComponent.checkCompleteButtonIsDisplayed();
|
||||||
await taskFormCloudComponent.clickCompleteButton();
|
await taskFormCloudComponent.clickCompleteButton();
|
||||||
@@ -122,9 +122,9 @@ describe('Form Field Component - Dropdown Widget', () => {
|
|||||||
await taskList.selectRow(task.entry.name);
|
await taskList.selectRow(task.entry.name);
|
||||||
|
|
||||||
await taskFormCloudComponent.formFields().checkFormIsDisplayed();
|
await taskFormCloudComponent.formFields().checkFormIsDisplayed();
|
||||||
await taskFormCloudComponent.formFields().checkWidgetIsVisible('Dropdown097maj');
|
await taskFormCloudComponent.formFields().checkWidgetIsVisible('DropdownOptions');
|
||||||
|
|
||||||
await expect(await dropdown.getSelectedOptionText('Dropdown097maj')).toBe('Clementine Bauch');
|
await expect(await dropdown.getSelectedOptionText('DropdownOptions')).toBe('option2');
|
||||||
|
|
||||||
await taskFormCloudComponent.checkCompleteButtonIsNotDisplayed();
|
await taskFormCloudComponent.checkCompleteButtonIsNotDisplayed();
|
||||||
});
|
});
|
||||||
|
@@ -69,11 +69,11 @@ describe('Process Header cloud component', () => {
|
|||||||
|
|
||||||
await apiService.login(testUser.username, testUser.password);
|
await apiService.login(testUser.username, testUser.password);
|
||||||
|
|
||||||
const dropdownRestProcess = await processDefinitionService.getProcessDefinitionByName(browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.processes.dropdownrestprocess, simpleApp);
|
const simpleProcess = await processDefinitionService.getProcessDefinitionByName(browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.processes.simpleProcess, simpleApp);
|
||||||
|
|
||||||
const processparent = await processDefinitionService.getProcessDefinitionByName(browser.params.resources.ACTIVITI_CLOUD_APPS.SUB_PROCESS_APP.processes.processparent, subProcessApp);
|
const processparent = await processDefinitionService.getProcessDefinitionByName(browser.params.resources.ACTIVITI_CLOUD_APPS.SUB_PROCESS_APP.processes.processparent, subProcessApp);
|
||||||
|
|
||||||
runningProcess = await processInstancesService.createProcessInstance(dropdownRestProcess.entry.key,
|
runningProcess = await processInstancesService.createProcessInstance(simpleProcess.entry.key,
|
||||||
simpleApp, { name: StringUtil.generateRandomString(), businessKey: 'test' });
|
simpleApp, { name: StringUtil.generateRandomString(), businessKey: 'test' });
|
||||||
|
|
||||||
runningCreatedDate = moment(runningProcess.entry.startDate).format(formatDate);
|
runningCreatedDate = moment(runningProcess.entry.startDate).format(formatDate);
|
||||||
|
@@ -28,7 +28,8 @@ import {
|
|||||||
TaskFormCloudComponent,
|
TaskFormCloudComponent,
|
||||||
TaskHeaderCloudPage,
|
TaskHeaderCloudPage,
|
||||||
TasksService,
|
TasksService,
|
||||||
FormCloudService
|
FormCloudService,
|
||||||
|
Logger
|
||||||
} from '@alfresco/adf-testing';
|
} from '@alfresco/adf-testing';
|
||||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||||
import { TasksCloudDemoPage } from './../pages/tasks-cloud-demo.page';
|
import { TasksCloudDemoPage } from './../pages/tasks-cloud-demo.page';
|
||||||
@@ -36,6 +37,7 @@ import { TasksCloudDemoPage } from './../pages/tasks-cloud-demo.page';
|
|||||||
describe('Task form cloud component', () => {
|
describe('Task form cloud component', () => {
|
||||||
|
|
||||||
const candidateBaseApp = browser.params.resources.ACTIVITI_CLOUD_APPS.CANDIDATE_BASE_APP.name;
|
const candidateBaseApp = browser.params.resources.ACTIVITI_CLOUD_APPS.CANDIDATE_BASE_APP.name;
|
||||||
|
const candidateBaseAppProcesses = browser.params.resources.ACTIVITI_CLOUD_APPS.CANDIDATE_BASE_APP.processes;
|
||||||
const simpleApp = browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.name;
|
const simpleApp = browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.name;
|
||||||
const simpleAppProcess = browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.processes;
|
const simpleAppProcess = browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.processes;
|
||||||
const simpleAppForm = browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.forms;
|
const simpleAppForm = browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.forms;
|
||||||
@@ -72,66 +74,69 @@ describe('Task form cloud component', () => {
|
|||||||
let dateTimerTaskId, dateTimerTask, dateTimerChangedTaskId, dateTimerChangedTask, dropdownOptionsTask;
|
let dateTimerTaskId, dateTimerTask, dateTimerChangedTaskId, dateTimerChangedTask, dropdownOptionsTask;
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
await apiService.loginWithProfile('hrUser');
|
try {
|
||||||
|
await apiService.loginWithProfile('hrUser');
|
||||||
|
createdTask = await tasksService.createStandaloneTask(StringUtil.generateRandomString(), candidateBaseApp);
|
||||||
|
|
||||||
createdTask = await tasksService.createStandaloneTask(StringUtil.generateRandomString(), candidateBaseApp);
|
assigneeTask = await tasksService.createStandaloneTask(StringUtil.generateRandomString(), candidateBaseApp);
|
||||||
|
await tasksService.claimTask(assigneeTask.entry.id, candidateBaseApp);
|
||||||
|
|
||||||
assigneeTask = await tasksService.createStandaloneTask(StringUtil.generateRandomString(), candidateBaseApp);
|
const formToTestValidationsKey = await formCloudService.getIdByFormName(candidateBaseApp,
|
||||||
await tasksService.claimTask(assigneeTask.entry.id, candidateBaseApp);
|
browser.params.resources.ACTIVITI_CLOUD_APPS.CANDIDATE_BASE_APP.forms.formtotestvalidations);
|
||||||
|
|
||||||
const formToTestValidationsKey = await formCloudService.getIdByFormName(candidateBaseApp,
|
formValidationsTask = await tasksService.createStandaloneTaskWithForm(StringUtil.generateRandomString(), candidateBaseApp, formToTestValidationsKey);
|
||||||
browser.params.resources.ACTIVITI_CLOUD_APPS.CANDIDATE_BASE_APP.forms.formtotestvalidations);
|
await tasksService.claimTask(formValidationsTask.entry.id, candidateBaseApp);
|
||||||
|
|
||||||
formValidationsTask = await tasksService.createStandaloneTaskWithForm(StringUtil.generateRandomString(), candidateBaseApp, formToTestValidationsKey);
|
toBeCompletedTask = await tasksService.createStandaloneTask(StringUtil.generateRandomString(), candidateBaseApp);
|
||||||
await tasksService.claimTask(formValidationsTask.entry.id, candidateBaseApp);
|
await tasksService.claimTask(toBeCompletedTask.entry.id, candidateBaseApp);
|
||||||
|
|
||||||
toBeCompletedTask = await tasksService.createStandaloneTask(StringUtil.generateRandomString(), candidateBaseApp);
|
completedTask = await tasksService.createStandaloneTask(assignedTaskName, candidateBaseApp);
|
||||||
await tasksService.claimTask(toBeCompletedTask.entry.id, candidateBaseApp);
|
await tasksService.claimTask(completedTask.entry.id, candidateBaseApp);
|
||||||
|
await tasksService.createAndCompleteTask(completedTaskName, candidateBaseApp);
|
||||||
|
|
||||||
completedTask = await tasksService.createStandaloneTask(assignedTaskName, candidateBaseApp);
|
let processDefinition = await processDefinitionService
|
||||||
await tasksService.claimTask(completedTask.entry.id, candidateBaseApp);
|
.getProcessDefinitionByName(candidateBaseAppProcesses.candidateUserProcess, candidateBaseApp);
|
||||||
await tasksService.createAndCompleteTask(completedTaskName, candidateBaseApp);
|
|
||||||
|
|
||||||
let processDefinition = await processDefinitionService
|
const candidateUsersProcessInstance = await processInstancesService.createProcessInstance(processDefinition.entry.key, candidateBaseApp);
|
||||||
.getProcessDefinitionByName(browser.params.resources.ACTIVITI_CLOUD_APPS.CANDIDATE_BASE_APP.processes.candidateUserProcess, candidateBaseApp);
|
|
||||||
|
|
||||||
const candidateUsersProcessInstance = await processInstancesService.createProcessInstance(processDefinition.entry.key, candidateBaseApp);
|
const processInstanceTasks = await queryService.getProcessInstanceTasks(candidateUsersProcessInstance.entry.id, candidateBaseApp);
|
||||||
|
candidateUsersTask = processInstanceTasks.list.entries[0];
|
||||||
|
await tasksService.claimTask(candidateUsersTask.entry.id, candidateBaseApp);
|
||||||
|
|
||||||
const processInstanceTasks = await queryService.getProcessInstanceTasks(candidateUsersProcessInstance.entry.id, candidateBaseApp);
|
processDefinition = await processDefinitionService
|
||||||
candidateUsersTask = processInstanceTasks.list.entries[0];
|
.getProcessDefinitionByName(candidateBaseAppProcesses.candidateUserProcess, candidateBaseApp);
|
||||||
await tasksService.claimTask(candidateUsersTask.entry.id, candidateBaseApp);
|
|
||||||
|
|
||||||
processDefinition = await processDefinitionService
|
const formProcess = await processInstancesService.createProcessInstance(processDefinition.entry.key, candidateBaseApp);
|
||||||
.getProcessDefinitionByName(simpleAppProcess.dropdownrestprocess, simpleApp);
|
const formTasks = await queryService.getProcessInstanceTasks(formProcess.entry.id, candidateBaseApp);
|
||||||
|
formTaskId = formTasks.list.entries[0].entry.id;
|
||||||
|
|
||||||
const formProcess = await processInstancesService.createProcessInstance(processDefinition.entry.key, simpleApp);
|
const dropdownOptionsId = await formCloudService.getIdByFormName(simpleApp, simpleAppForm.dropdownWithOptions.name);
|
||||||
const formTasks = await queryService.getProcessInstanceTasks(formProcess.entry.id, simpleApp);
|
dropdownOptionsTask = await tasksService.createStandaloneTaskWithForm(StringUtil.generateRandomString(),
|
||||||
formTaskId = formTasks.list.entries[0].entry.id;
|
simpleApp, dropdownOptionsId);
|
||||||
|
await tasksService.claimTask(dropdownOptionsTask.entry.id, simpleApp);
|
||||||
|
|
||||||
const dropdownOptionsId = await formCloudService.getIdByFormName(simpleApp, simpleAppForm.dropdownWithOptions.name);
|
const timerProcessDefinition = await processDefinitionService
|
||||||
dropdownOptionsTask = await tasksService.createStandaloneTaskWithForm(StringUtil.generateRandomString(),
|
.getProcessDefinitionByName(simpleAppProcess.intermediateDateProcessVarTimer, simpleApp);
|
||||||
simpleApp, dropdownOptionsId);
|
const dateTimerProcess = await processInstancesService.createProcessInstance(timerProcessDefinition.entry.key, simpleApp);
|
||||||
await tasksService.claimTask(dropdownOptionsTask.entry.id, simpleApp);
|
dateTimerTask = await queryService.getProcessInstanceTasks(dateTimerProcess.entry.id, simpleApp);
|
||||||
|
dateTimerTaskId = dateTimerTask.list.entries[0].entry.id;
|
||||||
|
|
||||||
const timerProcessDefinition = await processDefinitionService
|
const timerChangedProcessDefinition = await processDefinitionService
|
||||||
.getProcessDefinitionByName(simpleAppProcess.intermediateDateProcessVarTimer, simpleApp);
|
.getProcessDefinitionByName(simpleAppProcess.intermediateDateProcessVarTimer, simpleApp);
|
||||||
const dateTimerProcess = await processInstancesService.createProcessInstance(timerProcessDefinition.entry.key, simpleApp);
|
const dateTimerChangedProcess = await processInstancesService.createProcessInstance(timerChangedProcessDefinition.entry.key, simpleApp);
|
||||||
dateTimerTask = await queryService.getProcessInstanceTasks(dateTimerProcess.entry.id, simpleApp);
|
dateTimerChangedTask = await queryService.getProcessInstanceTasks(dateTimerChangedProcess.entry.id, simpleApp);
|
||||||
dateTimerTaskId = dateTimerTask.list.entries[0].entry.id;
|
dateTimerChangedTaskId = dateTimerChangedTask.list.entries[0].entry.id;
|
||||||
|
|
||||||
const timerChangedProcessDefinition = await processDefinitionService
|
/* cspell: disable-next-line */
|
||||||
.getProcessDefinitionByName(simpleAppProcess.intermediateDateProcessVarTimer, simpleApp);
|
const assigneeProcessDefinition = await processDefinitionService.getProcessDefinitionByName(simpleAppProcess.calledprocess, simpleApp);
|
||||||
const dateTimerChangedProcess = await processInstancesService.createProcessInstance(timerChangedProcessDefinition.entry.key, simpleApp);
|
const assigneeProcess = await processInstancesService.createProcessInstance(assigneeProcessDefinition.entry.key, simpleApp);
|
||||||
dateTimerChangedTask = await queryService.getProcessInstanceTasks(dateTimerChangedProcess.entry.id, simpleApp);
|
assigneeReleaseTask = await queryService.getProcessInstanceTasks(assigneeProcess.entry.id, simpleApp);
|
||||||
dateTimerChangedTaskId = dateTimerChangedTask.list.entries[0].entry.id;
|
assigneeTaskId = assigneeReleaseTask.list.entries[0].entry.id;
|
||||||
|
|
||||||
/* cspell: disable-next-line */
|
await loginSSOPage.loginWithProfile('hrUser');
|
||||||
const assigneeProcessDefinition = await processDefinitionService.getProcessDefinitionByName(simpleAppProcess.calledprocess, simpleApp);
|
} catch (error) {
|
||||||
const assigneeProcess = await processInstancesService.createProcessInstance(assigneeProcessDefinition.entry.key, simpleApp);
|
Logger.error('Error in beforeAll: ', error);
|
||||||
assigneeReleaseTask = await queryService.getProcessInstanceTasks(assigneeProcess.entry.id, simpleApp);
|
}
|
||||||
assigneeTaskId = assigneeReleaseTask.list.entries[0].entry.id;
|
|
||||||
|
|
||||||
await loginSSOPage.loginWithProfile('hrUser');
|
|
||||||
|
|
||||||
}, 5 * 60 * 1000);
|
}, 5 * 60 * 1000);
|
||||||
|
|
||||||
@@ -146,7 +151,7 @@ describe('Task form cloud component', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('[C310366] Should refresh buttons and form after an action is complete', async () => {
|
it('[C310366] Should refresh buttons and form after an action is complete', async () => {
|
||||||
await appListCloudComponent.goToApp(simpleApp);
|
await appListCloudComponent.goToApp(candidateBaseApp);
|
||||||
await taskFilter.clickTaskFilter(myTasksFilter);
|
await taskFilter.clickTaskFilter(myTasksFilter);
|
||||||
await taskList.getDataTable().waitTillContentLoaded();
|
await taskList.getDataTable().waitTillContentLoaded();
|
||||||
|
|
||||||
|
@@ -83,7 +83,7 @@ describe('Edit task filters and task list properties', () => {
|
|||||||
await tasksService.claimTask(notDisplayedTask.entry.id, candidateBaseApp);
|
await tasksService.claimTask(notDisplayedTask.entry.id, candidateBaseApp);
|
||||||
|
|
||||||
processDefinition = await processDefinitionService
|
processDefinition = await processDefinitionService
|
||||||
.getProcessDefinitionByName(browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.processes.dropdownrestprocess, simpleApp);
|
.getProcessDefinitionByName(browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.processes.candidateUsersGroup, simpleApp);
|
||||||
|
|
||||||
processInstance = await processInstancesService.createProcessInstance(processDefinition.entry.key, simpleApp);
|
processInstance = await processInstancesService.createProcessInstance(processDefinition.entry.key, simpleApp);
|
||||||
|
|
||||||
|
@@ -169,7 +169,7 @@ describe('Task filters cloud', () => {
|
|||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
const processDefinition = await processDefinitionService
|
const processDefinition = await processDefinitionService
|
||||||
.getProcessDefinitionByName(browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.processes.dropdownrestprocess, simpleApp);
|
.getProcessDefinitionByName(browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.processes.candidateUsersGroup, simpleApp);
|
||||||
|
|
||||||
const processInstance = await processInstancesService.createProcessInstance(processDefinition.entry.key, simpleApp);
|
const processInstance = await processInstancesService.createProcessInstance(processDefinition.entry.key, simpleApp);
|
||||||
taskAssigned = await queryService.getProcessInstanceTasks(processInstance.entry.id, simpleApp);
|
taskAssigned = await queryService.getProcessInstanceTasks(processInstance.entry.id, simpleApp);
|
||||||
|
@@ -5,6 +5,5 @@
|
|||||||
"C279931": "login problem APS not basic",
|
"C279931": "login problem APS not basic",
|
||||||
"C279930": "login problem APS not basic",
|
"C279930": "login problem APS not basic",
|
||||||
"C269081": "https://alfresco.atlassian.net/browse/ADF-5385",
|
"C269081": "https://alfresco.atlassian.net/browse/ADF-5385",
|
||||||
"C272819": "https://alfresco.atlassian.net/browse/ADF-5385",
|
"C272819": "https://alfresco.atlassian.net/browse/ADF-5385"
|
||||||
"C290069": "https://alfresco.atlassian.net/browse/ADF-5387"
|
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
@@ -146,25 +146,41 @@ describe('DropdownCloudWidgetComponent', () => {
|
|||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
|
|
||||||
it('should load data from restUrl and populate options', async(() => {
|
it('should load data from restUrl and populate options', async () => {
|
||||||
|
const jsonDataSpy = spyOn(formCloudService, 'getDropDownJsonData').and.returnValue(of(fakeOptionList));
|
||||||
widget.field = new FormFieldModel(new FormModel({ taskId: 'fake-task-id' }), {
|
widget.field = new FormFieldModel(new FormModel({ taskId: 'fake-task-id' }), {
|
||||||
id: 'dropdown-id',
|
id: 'dropdown-id',
|
||||||
name: 'date-name',
|
name: 'date-name',
|
||||||
type: 'dropdown-cloud',
|
type: 'dropdown-cloud',
|
||||||
readOnly: 'true',
|
readOnly: 'false',
|
||||||
restUrl: 'fake-rest-url',
|
restUrl: 'fake-rest-url',
|
||||||
optionType: 'rest',
|
optionType: 'rest',
|
||||||
restIdProperty: 'name'
|
restIdProperty: 'name'
|
||||||
});
|
});
|
||||||
const jsonDataSpy = spyOn(formCloudService, 'getDropDownJsonData').and.returnValue(of(fakeOptionList));
|
|
||||||
const optOne = fixture.debugElement.queryAll(By.css('[id="mat-option-1"]'));
|
|
||||||
widget.ngOnInit();
|
widget.ngOnInit();
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
fixture.whenStable().then(() => {
|
await fixture.whenStable();
|
||||||
expect(jsonDataSpy).toHaveBeenCalled();
|
|
||||||
expect(optOne).not.toBeNull();
|
const dropdown = fixture.debugElement.query(By.css('mat-select'));
|
||||||
});
|
dropdown.nativeElement.click();
|
||||||
}));
|
fixture.detectChanges();
|
||||||
|
await fixture.whenStable();
|
||||||
|
|
||||||
|
const optOne = fixture.debugElement.queryAll(By.css('[id="option_1"]'));
|
||||||
|
const optTwo = fixture.debugElement.queryAll(By.css('[id="option_2"]'));
|
||||||
|
const optThree = fixture.debugElement.queryAll(By.css('[id="option_3"]'));
|
||||||
|
const allOptions = fixture.debugElement.queryAll(By.css('mat-option'));
|
||||||
|
|
||||||
|
expect(jsonDataSpy).toHaveBeenCalled();
|
||||||
|
expect(allOptions.length).toEqual(3);
|
||||||
|
expect(optOne.length).toBe(1);
|
||||||
|
expect(optTwo.length).toBe(1);
|
||||||
|
expect(optThree.length).toBe(1);
|
||||||
|
expect(optOne[0].nativeElement.innerText).toEqual('option_1');
|
||||||
|
expect(optTwo[0].nativeElement.innerText).toEqual('option_2');
|
||||||
|
expect(optThree[0].nativeElement.innerText).toEqual('option_3');
|
||||||
|
});
|
||||||
|
|
||||||
it('should preselect dropdown widget value when Json (rest call) passed', (done) => {
|
it('should preselect dropdown widget value when Json (rest call) passed', (done) => {
|
||||||
widget.field = new FormFieldModel(new FormModel({ taskId: 'fake-task-id' }), {
|
widget.field = new FormFieldModel(new FormModel({ taskId: 'fake-task-id' }), {
|
||||||
|
@@ -79,7 +79,7 @@
|
|||||||
"processes": {
|
"processes": {
|
||||||
"processwithvariables": "processwithvariables",
|
"processwithvariables": "processwithvariables",
|
||||||
"simpleProcess": "simpleprocess",
|
"simpleProcess": "simpleprocess",
|
||||||
"dropdownrestprocess": "dropdownrestprocess",
|
"dropdownOptionsProcess": "dropdownoptionsprocess",
|
||||||
"multilingualprocess": "multilingualprocess",
|
"multilingualprocess": "multilingualprocess",
|
||||||
"processWithTabVisibility": "processwithtabvisibility",
|
"processWithTabVisibility": "processwithtabvisibility",
|
||||||
"startmessageevent": "start-message-event",
|
"startmessageevent": "start-message-event",
|
||||||
@@ -141,7 +141,7 @@
|
|||||||
"calledSimple":"called-simple",
|
"calledSimple":"called-simple",
|
||||||
"calledInPool":"called-in-pool",
|
"calledInPool":"called-in-pool",
|
||||||
"paralleltasks": "paralleltasks",
|
"paralleltasks": "paralleltasks",
|
||||||
"candidateusersgroup": "candidateusersgroup",
|
"candidateUsersGroup": "candidateusersgroup",
|
||||||
"candidateUserProcess": "candidateuserprocess",
|
"candidateUserProcess": "candidateuserprocess",
|
||||||
"outputVariablesMapping": "output-variables-mapping",
|
"outputVariablesMapping": "output-variables-mapping",
|
||||||
"outcomeVisibilityProcess": "outcome-visib-process",
|
"outcomeVisibilityProcess": "outcome-visib-process",
|
||||||
|
Reference in New Issue
Block a user