Skip to content

Commit

Permalink
fix: mock ids
Browse files Browse the repository at this point in the history
  • Loading branch information
marstamm committed Jan 12, 2024
1 parent ce95972 commit db41717
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions test/spec/BpmnPropertiesPanelRenderer.readonly.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
} from 'min-dom';

import Modeler from 'bpmn-js/lib/Modeler';
import NavigatedViewer from 'bpmn-js/lib/NavigatedViewer';
import NavigatedViewerOriginal from 'bpmn-js/lib/NavigatedViewer';

import BpmnPropertiesPanel from 'src/render';

Expand All @@ -32,6 +32,23 @@ import {
insertCSS
} from '../TestHelper';

class NavigatedViewer extends NavigatedViewerOriginal {
_createModdle(options) {
const moddle = super._createModdle(options);

moddle.ids = {
isIdValid() {
return true;
},
assigned() {
return false;
}
};

return moddle;
}
}

insertCoreStyles();
insertBpmnStyles();

Expand All @@ -40,6 +57,9 @@ insertCSS('readonly-properties-panel', `
.bio-properties-panel-checkbox {
pointer-events: none;
}
.bio-properties-panel-add-entry {
display: none!important;
}
`);


Expand Down Expand Up @@ -92,7 +112,6 @@ describe('<BpmnPropertiesPanelRenderer>', function() {
additionalModules,
moddleExtensions,
propertiesPanel: {
parent: propertiesContainer,
feelTooltipContainer: container,
description,
tooltip,
Expand All @@ -112,6 +131,9 @@ describe('<BpmnPropertiesPanelRenderer>', function() {
try {
const result = await modeler.importXML(xml);

const propertiesPanel = modeler.get('propertiesPanel');
propertiesPanel.attachTo(propertiesContainer);

return { error: null, warnings: result.warnings, modeler: modeler };
} catch (err) {
return { error: err, warnings: err.warnings, modeler: modeler };
Expand Down

0 comments on commit db41717

Please sign in to comment.