fix: test random-spec expect

This commit is contained in:
shiwu.wyy 2019-09-17 14:52:27 +08:00
parent 221f5bbd26
commit 1cbc40ffd0
2 changed files with 6 additions and 3 deletions

View File

@ -100,7 +100,7 @@
"screenshot": "node ./bin/screenshot.js",
"start": "npm run dev",
"test": "torch --compile --renderer --opts test/mocha.opts --recursive ./test/unit",
"test-live": "torch --compile --interactive --watch --opts test/mocha.opts --recursive ./test/unit/graph/graph-spec.js",
"test-live": "torch --compile --interactive --watch --opts test/mocha.opts --recursive ./test/unit/",
"test-bugs": "torch --compile --renderer --recursive ./test/bugs",
"test-bugs-live": "torch --compile --interactive --watch --recursive ./test/bugs",
"test-all": "npm run test && npm run test-bugs",

View File

@ -20,7 +20,7 @@ const data = {
]
};
describe('random', () => {
describe('random by default', () => {
it('new graph without layout', () => {
const graph = new G6.Graph({
container: div,
@ -29,6 +29,9 @@ describe('random', () => {
});
graph.data(data);
graph.render();
// expect(length - div.childNodes.length).to.equal(1);
expect(graph.getNodes()[0].getModel().x).not.to.be.undefined;
expect(graph.getNodes()[0].getModel().y).not.to.be.undefined;
expect(graph.getNodes()[1].getModel().x).not.to.be.undefined;
expect(graph.getNodes()[1].getModel().y).not.to.be.undefined;
});
});