feat(tests): add remove edge

This commit is contained in:
moklick
2019-10-04 22:33:11 +02:00
parent cd558f22ee
commit 04252b322f
5 changed files with 33 additions and 20 deletions
+4 -4
View File
@@ -7,8 +7,8 @@ import store from '../../store';
export default EdgeComponent => {
const EdgeWrapper = memo((props) => {
const {
source, target, animated, type,
selected, onClick
id, source, target, type,
animated, selected, onClick
} = props;
const edgeClasses = cx('react-graph__edge', { selected, animated });
const onEdgeClick = (evt) => {
@@ -16,8 +16,8 @@ export default EdgeComponent => {
return false;
}
store.dispatch.setSelectedElements({ source, target });
onClick({ source, target, type });
store.dispatch.setSelectedElements({ id, source, target });
onClick({ id, source, target, type });
};
return (
+1 -1
View File
@@ -15,7 +15,7 @@ export const getOutgoers = (node, elements) => {
};
export const removeElements = (elements, elementsToRemove) => {
const nodeIdsToRemove = elementsToRemove.filter(isNode).map(n => n.id);
const nodeIdsToRemove = elementsToRemove.map(n => n.id);
return elements.filter(e => {
return (