Handle Broken Tests 2

This commit is contained in:
theaubmov 2023-12-02 17:25:59 +01:00
parent e598f86fe3
commit d3a1f38258
2 changed files with 64 additions and 9 deletions

View File

@ -88,7 +88,7 @@ describe('DataObject Interceptor', function() {
const dataObjects = findDataObjects(rootShape.businessObject);
expect(dataObjects.length).to.equal(0);
}));
// it('Creating a new Reference will update the name to match the DataObject', inject(function(canvas, modeling) {
// // IF - a Data Reference Exists
@ -165,4 +165,28 @@ describe('DataObject Interceptor', function() {
}));
// it('should not allow two dataObjects to have the same ID', inject(async function(canvas, modeling) {
// // Creating the first dataObject
// let rootShape = canvas.getRootElement();
// const dataObject1 = modeling.createShape({ type: 'bpmn:DataObject' },
// { x: 100, y: 100 }, rootShape);
// // Creating the second dataObject
// const dataObject2 = modeling.createShape({ type: 'bpmn:DataObject' },
// { x: 150, y: 100 }, rootShape);
// await expectSelected(dataObject2.id);
// let entry = findEntry('dataObjectId', container);
// let idInput = findInput('text', entry);
// const duplicateId = dataObject1.businessObject.id;
// changeInput(idInput, duplicateId);
// // Checkk that the ID change is not successful
// expect(dataObject2.businessObject.id).not.to.equal(duplicateId);
// }));
});

View File

@ -62,6 +62,9 @@ describe('Properties Panel for Data Objects', function() {
expect(businessObject.get('dataObjectRef').id).to.equal('my_third_data_object');
});
// Notice: Test Case for Data Object ID Changes No Longer Required
// With our new feature implementation, changing a Data Object ID is now independent of altering
// its Data Reference Name. This decoupling eliminates the need for the specific test case previously required for these changes.
// it('renaming a data object, changes to the label of references', async function() {
// // IF - a process is selected, and the name of a data object is changed.
@ -74,18 +77,46 @@ describe('Properties Panel for Data Objects', function() {
// expect(my_data_ref_1.businessObject.dataObjectRef.id).to.equal('my_nifty_new_name');
// expect(my_data_ref_1.businessObject.name).to.equal('My Nifty New Name');
// });
it('renaming a data object creates a lable without losing the numbers', async function() {
// it('renaming a data object creates a lable without losing the numbers', async function() {
// IF - a process is selected, and the name of a data object is changed.
let entry = findEntry('ProcessTest-dataObj-2-id', container);
let textInput = findInput('text', entry);
changeInput(textInput, 'MyObject1');
let my_data_ref_1 = await expectSelected('my_data_ref_1');
// // IF - a process is selected, and the name of a data object is changed.
// let entry = findEntry('ProcessTest-dataObj-2-id', container);
// let textInput = findInput('text', entry);
// changeInput(textInput, 'MyObject1');
// THEN - both the data object itself, and the label of any references are updated.
expect(my_data_ref_1.businessObject.dataObjectRef.id).to.equal('MyObject1');
// Notice: Test Case for Data Object ID Changes No Longer Required
// expect(my_data_ref_1.businessObject.name).to.equal('My Object 1');
});
it('renaming a data object, does not change the label of references', async function() {
// IF - a process is selected, and the name of a data object is changed.
let entry = findEntry('ProcessTest-dataObj-2-id', container);
let textInput = findInput('text', entry);
changeInput(textInput, 'my_nifty_new_name');
let my_data_ref_1 = await expectSelected('my_data_ref_1');
// THEN - both the data object itself, and the label of any references are updated.
expect(my_data_ref_1.businessObject.dataObjectRef.id).to.equal('my_nifty_new_name');
expect(my_data_ref_1.businessObject.name).not.to.equal('My Nifty New Name');
});
// it('selecting a different data object should not change the data object reference name.', async function() {
// // IF - a data object reference is selected
// let my_data_ref_1 = await expectSelected('my_data_ref_1');
// // THEN - both the data object itself, and the label of any references are updated.
// expect(my_data_ref_1.businessObject.dataObjectRef.id).to.equal('MyObject1');
// expect(my_data_ref_1.businessObject.name).to.equal('My Object 1');
// let entry = findEntry('selectDataObject', container);
// let selector = findSelect(entry);
// let businessObject = my_data_ref_1.businessObject;
// changeInput(selector, 'my_third_data_object');
// expect(businessObject.get('dataObjectRef').id).to.equal('my_third_data_object');
// expect(businessObject.name).to.equal('my_data_object');
// expect(businessObject.name).not.to.equal('My Third Data Object');
// });
});