mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of https://github.com/triAGENS/ArangoDB into devel
This commit is contained in:
commit
20ea5ed0f8
|
@ -65,7 +65,7 @@ var helper = helper || {};
|
|||
var evt = document.createEvent("MouseEvents"),
|
||||
testee = document.getElementById(objectId);
|
||||
evt.initMouseEvent("DOMMouseScroll", true, true, window,
|
||||
10, 0, 0, 0, 0, false, false, false, false, 0, null);
|
||||
-10, 0, 0, 0, 0, false, false, false, false, 0, null);
|
||||
testee.dispatchEvent(evt);
|
||||
};
|
||||
|
||||
|
@ -73,7 +73,7 @@ var helper = helper || {};
|
|||
var evt = document.createEvent("MouseEvents"),
|
||||
testee = document.getElementById(objectId);
|
||||
evt.initMouseEvent("DOMMouseScroll", true, true, window,
|
||||
-10, 0, 0, 0, 0, false, false, false, false, 0, null);
|
||||
10, 0, 0, 0, 0, false, false, false, false, 0, null);
|
||||
testee.dispatchEvent(evt);
|
||||
};
|
||||
|
||||
|
@ -84,4 +84,4 @@ var helper = helper || {};
|
|||
$("body").trigger(press);
|
||||
};
|
||||
|
||||
}());
|
||||
}());
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/*global runs, waitsFor, spyOn */
|
||||
/*global window, eb, loadFixtures, document */
|
||||
/*global $, _, d3*/
|
||||
/*global helper, mocks*/
|
||||
/*global helper, mocks, uiMatchers*/
|
||||
/*global EventDispatcher, EventDispatcherControls, NodeShaper, EdgeShaper*/
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -169,35 +169,9 @@
|
|||
spyOn(nodeShaper, "changeTo").andCallThrough();
|
||||
spyOn(edgeShaper, "changeTo").andCallThrough();
|
||||
|
||||
|
||||
uiMatchers.define(this);
|
||||
|
||||
this.addMatchers({
|
||||
toBeTag: function(name) {
|
||||
var item = this.actual;
|
||||
this.message = function() {
|
||||
return "Expected " + item.tagName.toLowerCase() + " to be " + name;
|
||||
};
|
||||
return item.tagName.toLowerCase() === name;
|
||||
},
|
||||
|
||||
toBeOfClass: function(name) {
|
||||
var item = this.actual;
|
||||
this.message = function() {
|
||||
return "Expected " + item.className + " to be " + name;
|
||||
};
|
||||
return $(item).hasClass(name);
|
||||
},
|
||||
toConformToToolboxBKP: function() {
|
||||
var box = this.actual;
|
||||
_.each(box.children, function(btn) {
|
||||
expect(btn).toBeTag("button");
|
||||
expect(btn).toBeOfClass("btn btn-icon");
|
||||
expect(btn.children.length).toEqual(1);
|
||||
expect(btn.firstChild).toBeTag("i");
|
||||
expect(btn.firstChild.className).toMatch(/^icon-\S+ icon-white$/);
|
||||
});
|
||||
return true;
|
||||
},
|
||||
|
||||
toConformToToolbox: function() {
|
||||
var box = this.actual,
|
||||
foundActive = false,
|
||||
|
@ -205,10 +179,9 @@
|
|||
_.each(box.children, function(btn) {
|
||||
expect(btn).toBeTag("button");
|
||||
expect(btn).toBeOfClass("btn btn-icon");
|
||||
expect(btn.children.length).toEqual(1);
|
||||
expect(btn.firstChild).toBeTag("img");
|
||||
expect(btn.firstChild).toBeOfClass("gv-icon-btn");
|
||||
if ($(btn.firstChild).hasClass("active")) {
|
||||
expect(btn).toBeOfClass("btn-icon");
|
||||
expect(btn).toBeOfClass("gv-icon-btn");
|
||||
if ($(btn).hasClass("active")) {
|
||||
if (foundActive) {
|
||||
failed = true;
|
||||
} else {
|
||||
|
@ -835,4 +808,4 @@
|
|||
});
|
||||
});
|
||||
|
||||
}());
|
||||
}());
|
||||
|
|
|
@ -214,7 +214,7 @@
|
|||
});
|
||||
|
||||
});
|
||||
|
||||
/*
|
||||
it('should position the first node in the centre', function() {
|
||||
runs(function() {
|
||||
standardConfig.nodes = createNodeList(1);
|
||||
|
@ -239,7 +239,7 @@
|
|||
expect(nodes[0]).toBeCloseToNode(center);
|
||||
});
|
||||
});
|
||||
|
||||
*/
|
||||
it('should position not linked nodes close to each other', function() {
|
||||
runs(function() {
|
||||
nodes = createNodeList(4);
|
||||
|
@ -373,7 +373,7 @@
|
|||
expect(func({
|
||||
source: {},
|
||||
target: {}
|
||||
})).toEqual(config.distance);
|
||||
})).toEqual(2 * config.distance);
|
||||
});
|
||||
|
||||
it('should set the gravity', function() {
|
||||
|
@ -445,7 +445,7 @@
|
|||
expect(func({
|
||||
source: {},
|
||||
target: {}
|
||||
})).toEqual(200);
|
||||
})).toEqual(2 * 200);
|
||||
});
|
||||
|
||||
it('should be able to switch the gravity', function() {
|
||||
|
@ -568,4 +568,4 @@
|
|||
*/
|
||||
});
|
||||
|
||||
}());
|
||||
}());
|
||||
|
|
|
@ -374,7 +374,7 @@
|
|||
expect($("#control_node_list #control_node_labelandcolour")[0]).toConformToListCSS();
|
||||
|
||||
helper.simulateMouseEvent("click", "control_node_labelandcolour");
|
||||
$("#control_node_labelandcolour_key").attr("value", "label");
|
||||
$("#control_node_labelandcolour_label-attribute").attr("value", "label");
|
||||
helper.simulateMouseEvent("click", "control_node_labelandcolour_submit");
|
||||
|
||||
expect(shaper.changeTo).toHaveBeenCalledWith({
|
||||
|
@ -400,4 +400,4 @@
|
|||
});
|
||||
});
|
||||
|
||||
}());
|
||||
}());
|
||||
|
|
|
@ -479,4 +479,4 @@
|
|||
});
|
||||
});
|
||||
|
||||
}());
|
||||
}());
|
||||
|
|
|
@ -226,7 +226,7 @@ function NodeShaperControls(list, shaper) {
|
|||
idprefix, [{
|
||||
type: "text",
|
||||
id: "label-attribute",
|
||||
text: "Vertex label attribute"
|
||||
text: "Vertex label attribute"
|
||||
},{
|
||||
type: "decission",
|
||||
id: "samecolour",
|
||||
|
@ -240,11 +240,11 @@ function NodeShaperControls(list, shaper) {
|
|||
text: "Use different attribute for coloring",
|
||||
isDefault: false,
|
||||
interior: [
|
||||
{
|
||||
type: "text",
|
||||
id: "colour-attribute",
|
||||
text: "Color attribute"
|
||||
}
|
||||
{
|
||||
type: "text",
|
||||
id: "colour-attribute",
|
||||
text: "Color attribute"
|
||||
}
|
||||
]
|
||||
}], function () {
|
||||
var key = $("#" + idprefix + "label-attribute").attr("value"),
|
||||
|
|
Loading…
Reference in New Issue