mirror of
https://gitee.com/antv/g6.git
synced 2024-12-02 03:38:20 +08:00
fix test spec
This commit is contained in:
parent
98eb20da5c
commit
31e40702cd
@ -6,6 +6,7 @@
|
|||||||
const G6 = require('@antv/g6');
|
const G6 = require('@antv/g6');
|
||||||
const Util = G6.Util;
|
const Util = G6.Util;
|
||||||
const Fisheye = require('./tool');
|
const Fisheye = require('./tool');
|
||||||
|
|
||||||
class Plugin {
|
class Plugin {
|
||||||
constructor(options) {
|
constructor(options) {
|
||||||
Util.mix(this, options);
|
Util.mix(this, options);
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
const G6 = require('../../../src/index');
|
const G6 = require('../../../src/index');
|
||||||
const expect = require('chai').expect;
|
const chai = require('chai');
|
||||||
|
const expect = chai.expect;
|
||||||
const Simulate = require('event-simulate');
|
const Simulate = require('event-simulate');
|
||||||
const Fisheye = require('../../../plugins/tool.fisheye/');
|
const Fisheye = require('../../../plugins/tool.fisheye/');
|
||||||
|
const chaiAlmost = require('chai-almost');
|
||||||
|
chai.use(chaiAlmost());
|
||||||
|
|
||||||
describe('fisheye test', () => {
|
describe('fisheye test', () => {
|
||||||
const fisheye = new Fisheye();
|
const fisheye = new Fisheye();
|
||||||
@ -177,7 +180,7 @@ describe('fisheye test', () => {
|
|||||||
clientX: clientPoint.x,
|
clientX: clientPoint.x,
|
||||||
clientY: clientPoint.y
|
clientY: clientPoint.y
|
||||||
});
|
});
|
||||||
expect([ node1Model.x, node1Model.y ]).eql([ 130, 200 ]);
|
expect([ node1Model.x, node1Model.y ]).to.be.deep.almost([ 130, 200 ], 5);
|
||||||
expect(div.childNodes.length).not.eql(0);
|
expect(div.childNodes.length).not.eql(0);
|
||||||
done();
|
done();
|
||||||
}, 100);
|
}, 100);
|
||||||
|
Loading…
Reference in New Issue
Block a user