Skip to content

Commit

Permalink
fix(graph): empty groups on new graph
Browse files Browse the repository at this point in the history
Previously, groups from a previous graph
were inherited when creating a new one.
  • Loading branch information
davidballester committed Aug 7, 2019
1 parent 4be2878 commit 5e0c233
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/ducks/graph/graph.reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ export default function reducer(state = initialState, action) {
name: '',
nodes: {},
links: {},
groups: {},
...graph,
};
}
Expand Down
4 changes: 4 additions & 0 deletions src/ducks/graph/graph.reducer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,16 @@ describe('reducer', () => {
links: {
bar: {},
},
groups: {
baz: {},
},
};
const expectedState = {
id: 'uuid',
name: '',
nodes: {},
links: {},
groups: {},
};
const action = createGraph({});
const state = reducer(initialState, action);
Expand Down

0 comments on commit 5e0c233

Please sign in to comment.