mirror of https://gitee.com/bigwinds/arangodb
Added a test for the FoxxAdapter in the graphViewer
This commit is contained in:
parent
2f113aea14
commit
0bbf2cf4e5
|
@ -40,9 +40,7 @@ function FoxxAdapter(nodes, edges, route, config) {
|
|||
if (route === undefined) {
|
||||
throw "The route has to be given.";
|
||||
}
|
||||
|
||||
|
||||
|
||||
var self = this,
|
||||
absAdapter = new AbstractAdapter(nodes, edges),
|
||||
routes = {},
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, white: true plusplus: true */
|
||||
/*global _*/
|
||||
/*global ArangoAdapter, JSONAdapter */
|
||||
/*global ArangoAdapter, JSONAdapter, FoxxAdapter */
|
||||
/*global ForceLayouter, EdgeShaper, NodeShaper, ZoomManager */
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief Graph functionality
|
||||
|
|
|
@ -113,6 +113,19 @@ describe("Graph Viewer", function() {
|
|||
).not.toThrow();
|
||||
});
|
||||
|
||||
it('should be able to be setup with a foxx adapter', function() {
|
||||
var route = "foxx/route",
|
||||
adapterConfig = {type: "foxx", route: route},
|
||||
gv;
|
||||
spyOn(window, "FoxxAdapter");
|
||||
gv = new GraphViewer(svg, 10, 10, adapterConfig);
|
||||
expect(window.FoxxAdapter).wasCalledWith(
|
||||
jasmine.any(Array),
|
||||
jasmine.any(Array),
|
||||
route,
|
||||
jasmine.any(Object)
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue