mirror of
https://gitee.com/antv/g6.git
synced 2024-12-05 05:09:07 +08:00
fix: test error.
This commit is contained in:
parent
5a3c62edaa
commit
c53cc2f5e6
@ -41,12 +41,6 @@ const data = {
|
|||||||
|
|
||||||
const data2 = {
|
const data2 = {
|
||||||
nodes: [
|
nodes: [
|
||||||
// { id: '0', label: '0', x: 100, y: 20 },
|
|
||||||
// { id: '1', label: '1', x: 10, y: 210 },
|
|
||||||
// { id: '2', label: '2', x: 150, y: 100 },
|
|
||||||
// { id: '3', label: '3', x: 120, y: 100 },
|
|
||||||
// { id: '4', label: '4', x: 50, y: 250 },
|
|
||||||
// { id: '5', label: '5', x: 130, y: 50 }
|
|
||||||
{ id: '0', label: '0' },
|
{ id: '0', label: '0' },
|
||||||
{ id: '1', label: '1' },
|
{ id: '1', label: '1' },
|
||||||
{ id: '2', label: '2' },
|
{ id: '2', label: '2' },
|
||||||
@ -149,7 +143,7 @@ describe('layout controller', () => {
|
|||||||
expect(layoutType).to.equal('fruchterman');
|
expect(layoutType).to.equal('fruchterman');
|
||||||
expect(Object.getOwnPropertyNames(layoutCfg).length).to.equal(1);
|
expect(Object.getOwnPropertyNames(layoutCfg).length).to.equal(1);
|
||||||
});
|
});
|
||||||
it('default layout without data', () => {
|
it('default layout without data and destroy', () => {
|
||||||
const graph2 = new G6.Graph({
|
const graph2 = new G6.Graph({
|
||||||
container: div,
|
container: div,
|
||||||
width: 500,
|
width: 500,
|
||||||
@ -160,10 +154,6 @@ describe('layout controller', () => {
|
|||||||
const layoutController = graph2.get('layoutController');
|
const layoutController = graph2.get('layoutController');
|
||||||
expect(layoutController).not.to.be.undefined;
|
expect(layoutController).not.to.be.undefined;
|
||||||
graph2.destroy();
|
graph2.destroy();
|
||||||
});
|
|
||||||
it('graph destroy, layoutController destroy', () => {
|
|
||||||
const layoutController = graph.get('layoutController');
|
|
||||||
graph.destroy();
|
|
||||||
expect(layoutController.destroyed).to.be.true;
|
expect(layoutController.destroyed).to.be.true;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user