forked from cytoscape/cytoscape.js
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcore-export.js
52 lines (42 loc) · 1.8 KB
/
core-export.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
var expect = require('chai').expect;
var cytoscape = require('../build/cytoscape.js', cytoscape);
describe('Core export', function(){
var cy;
// test setup
beforeEach(function(done){
cytoscape({
styleEnabled: true,
elements: {
nodes: [
{ data: { id: "n1", foo: "bar" }, classes: "odd one" },
]
},
ready: function(){
cy = this;
done();
}
});
});
it('has all properties defined', function(){
var json = cy.json();
expect( json ).to.have.property('elements');
expect( json ).to.have.property('layout');
expect( json ).to.have.property('renderer');
expect( json ).to.have.property('minZoom').that.equals( cy.minZoom() );
expect( json ).to.have.property('maxZoom').that.equals( cy.maxZoom() );
expect( json ).to.have.property('zoomingEnabled').that.equals( cy.zoomingEnabled() );
expect( json ).to.have.property('userZoomingEnabled').that.equals( cy.userZoomingEnabled() );
expect( json ).to.have.property('panningEnabled').that.equals( cy.panningEnabled() );
expect( json ).to.have.property('userPanningEnabled').that.equals( cy.userPanningEnabled() );
expect( json ).to.have.property('boxSelectionEnabled').that.equals( cy.boxSelectionEnabled() );
expect( json ).to.have.property('zoom').that.equals( cy.zoom() );
expect( json ).to.have.property('pan').that.deep.equals( cy.pan() );
expect( json ).to.have.property('style');
// these are optional so not important to check
// expect( json ).to.have.property('hideEdgesOnViewport');
// expect( json ).to.have.property('hideLabelsOnViewport');
// expect( json ).to.have.property('textureOnViewport');
// expect( json ).to.have.property('wheelSensitivity');
// expect( json ).to.have.property('motionBlur');
});
});