diff --git a/client/src/components/overlays/FeaturePanel.test.js b/client/src/components/overlays/FeaturePanel.test.js index 321d6c32..481d8853 100644 --- a/client/src/components/overlays/FeaturePanel.test.js +++ b/client/src/components/overlays/FeaturePanel.test.js @@ -42,7 +42,7 @@ describe('FeaturePanel', () => { it('renders footer content', () => { const wrapper = featurePanel(), - footerWrapper = shallow(wrapper.instance().onRenderFooterContent()); - expect(footerWrapper.prop('items')).not.toHaveLength(0); + footer = wrapper.instance().onRenderFooterContent(); + expect(footer.props.items).not.toHaveLength(0); }); }); \ No newline at end of file diff --git a/client/src/components/overlays/__snapshots__/FeatureContextualMenu.test.js.snap b/client/src/components/overlays/__snapshots__/FeatureContextualMenu.test.js.snap index 017fde60..80bfa785 100644 --- a/client/src/components/overlays/__snapshots__/FeatureContextualMenu.test.js.snap +++ b/client/src/components/overlays/__snapshots__/FeatureContextualMenu.test.js.snap @@ -103,6 +103,96 @@ exports[`FeatureContextualMenu renders correctly for a selection of features 1`] }, "text": "Collapse", }, + Object { + "itemType": 1, + "key": "divider", + }, + Object { + "iconProps": Object { + "iconName": "FieldNotChanged", + }, + "key": "propertiesMenu", + "subMenuProps": Object { + "items": Array [ + Object { + "canCheck": true, + "disabled": false, + "isChecked": false, + "key": "abstract", + "onClick": [Function], + "text": "Abstract", + }, + Object { + "canCheck": true, + "disabled": true, + "isChecked": true, + "key": "concrete", + "onClick": [Function], + "text": "Concrete", + }, + Object { + "itemType": 1, + "key": "divider", + }, + Object { + "canCheck": true, + "isChecked": false, + "key": "hidden", + "onClick": [Function], + "text": "Hidden", + }, + Object { + "itemType": 1, + "key": "divider", + }, + Object { + "canCheck": true, + "disabled": true, + "isChecked": false, + "key": "mandatory", + "onClick": [Function], + "text": "Mandatory", + }, + Object { + "canCheck": true, + "disabled": true, + "isChecked": false, + "key": "optional", + "onClick": [Function], + "text": "Optional", + }, + Object { + "itemType": 1, + "key": "divider", + }, + Object { + "canCheck": true, + "disabled": false, + "isChecked": false, + "key": "and", + "onClick": [Function], + "text": "And", + }, + Object { + "canCheck": true, + "disabled": false, + "isChecked": false, + "key": "or", + "onClick": [Function], + "text": "Or", + }, + Object { + "canCheck": true, + "disabled": false, + "isChecked": false, + "key": "alternative", + "onClick": [Function], + "text": "Alternative", + }, + ], + }, + "text": "Properties", + }, ] } onDismiss={[Function]} @@ -257,6 +347,7 @@ exports[`FeatureContextualMenu renders correctly for a single feature 1`] = ` "items": Array [ Object { "canCheck": true, + "disabled": false, "isChecked": false, "key": "abstract", "onClick": [Function], @@ -264,6 +355,7 @@ exports[`FeatureContextualMenu renders correctly for a single feature 1`] = ` }, Object { "canCheck": true, + "disabled": true, "isChecked": true, "key": "concrete", "onClick": [Function], @@ -294,7 +386,7 @@ exports[`FeatureContextualMenu renders correctly for a single feature 1`] = ` }, Object { "canCheck": true, - "disabled": false, + "disabled": true, "isChecked": true, "key": "optional", "onClick": [Function], @@ -314,7 +406,7 @@ exports[`FeatureContextualMenu renders correctly for a single feature 1`] = ` }, Object { "canCheck": true, - "disabled": false, + "disabled": true, "isChecked": true, "key": "or", "onClick": [Function], diff --git a/client/src/server/messageActions.test.js b/client/src/server/messageActions.test.js index 10f15c66..4956dd56 100644 --- a/client/src/server/messageActions.test.js +++ b/client/src/server/messageActions.test.js @@ -42,19 +42,19 @@ describe('messageActions', () => { describe('properties', () => { it('sets the abstract property', () => { - messageActions.featureDiagram.feature.properties.setAbstract('FeatureIDE', true); + messageActions.featureDiagram.feature.properties.setAbstract(['FeatureIDE'], true); expect(sendMessage).lastCalledWith( {type: messageTypes.FEATURE_DIAGRAM_FEATURE_SET_PROPERTY, feature: 'FeatureIDE', property: propertyTypes.abstract, value: true}); }); it('sets the hidden property', () => { - messageActions.featureDiagram.feature.properties.setHidden('FeatureIDE', true); + messageActions.featureDiagram.feature.properties.setHidden(['FeatureIDE'], true); expect(sendMessage).lastCalledWith( {type: messageTypes.FEATURE_DIAGRAM_FEATURE_SET_PROPERTY, feature: 'FeatureIDE', property: propertyTypes.hidden, value: true}); }); it('sets the mandatory property', () => { - messageActions.featureDiagram.feature.properties.setMandatory('FeatureIDE', true); + messageActions.featureDiagram.feature.properties.setMandatory(['FeatureIDE'], true); expect(sendMessage).lastCalledWith( {type: messageTypes.FEATURE_DIAGRAM_FEATURE_SET_PROPERTY, feature: 'FeatureIDE', property: propertyTypes.mandatory, value: true}); }); @@ -70,7 +70,7 @@ describe('messageActions', () => { }); it('changes the group type to and', () => { - messageActions.featureDiagram.feature.properties.setAnd('FeatureIDE'); + messageActions.featureDiagram.feature.properties.setAnd(['FeatureIDE']); expect(sendMessage).lastCalledWith({ type: messageTypes.FEATURE_DIAGRAM_FEATURE_SET_PROPERTY, feature: 'FeatureIDE', @@ -80,7 +80,7 @@ describe('messageActions', () => { }); it('changes the group type to or', () => { - messageActions.featureDiagram.feature.properties.setOr('FeatureIDE'); + messageActions.featureDiagram.feature.properties.setOr(['FeatureIDE']); expect(sendMessage).lastCalledWith({ type: messageTypes.FEATURE_DIAGRAM_FEATURE_SET_PROPERTY, feature: 'FeatureIDE', @@ -90,7 +90,7 @@ describe('messageActions', () => { }); it('changes the group type to alternative', () => { - messageActions.featureDiagram.feature.properties.setAlternative('FeatureIDE'); + messageActions.featureDiagram.feature.properties.setAlternative(['FeatureIDE']); expect(sendMessage).lastCalledWith({ type: messageTypes.FEATURE_DIAGRAM_FEATURE_SET_PROPERTY, feature: 'FeatureIDE',