Skip to content

Commit

Permalink
Adapt auto-save tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bergie committed Jan 14, 2021
1 parent 7d8fa16 commit 8905fb2
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions spec/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,9 @@ cases:
library: 'auto-save',
id: graphName,
main: false,
environment: {
type: 'noflo-nodejs',
},
});
graphInstance.addNode('one', 'auto-save/Plusser');
graphInstance.addNode('two', 'core/Output');
Expand All @@ -273,8 +276,10 @@ cases:
))
.then((contents) => {
graphFound = true;
const originalGraphJson = JSON.parse(JSON.stringify(graphInstance.toJSON()));
delete originalGraphJson.properties.id;
const graphJson = JSON.parse(contents);
expect(graphJson).to.eql(JSON.parse(JSON.stringify(graphInstance.toJSON())));
expect(graphJson).to.eql(originalGraphJson);
}));
});
describe('editing a graph with namespaced name', () => {
Expand All @@ -288,6 +293,9 @@ cases:
library: 'auto-save',
id: `default/${graphName}`,
main: true,
environment: {
type: 'noflo-nodejs',
},
});
graphInstance.addNode('one', 'auto-save/Plusser');
graphInstance.addNode('two', 'core/Output');
Expand All @@ -312,8 +320,10 @@ cases:
))
.then((contents) => {
graphFound = true;
const originalGraphJson = JSON.parse(JSON.stringify(graphInstance.toJSON()));
delete originalGraphJson.properties.id;
const graphJson = JSON.parse(contents);
expect(graphJson).to.eql(JSON.parse(JSON.stringify(graphInstance.toJSON())));
expect(graphJson).to.eql(originalGraphJson);
}));
});
});
Expand Down

0 comments on commit 8905fb2

Please sign in to comment.