1
0
Fork 0

Merge branch 'devel' of https://github.com/triAGENS/ArangoDB into devel

This commit is contained in:
Heiko Kernbach 2013-08-06 14:08:37 +02:00
commit 20ea5ed0f8
6 changed files with 24 additions and 51 deletions

View File

@ -65,7 +65,7 @@ var helper = helper || {};
var evt = document.createEvent("MouseEvents"), var evt = document.createEvent("MouseEvents"),
testee = document.getElementById(objectId); testee = document.getElementById(objectId);
evt.initMouseEvent("DOMMouseScroll", true, true, window, 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); testee.dispatchEvent(evt);
}; };
@ -73,7 +73,7 @@ var helper = helper || {};
var evt = document.createEvent("MouseEvents"), var evt = document.createEvent("MouseEvents"),
testee = document.getElementById(objectId); testee = document.getElementById(objectId);
evt.initMouseEvent("DOMMouseScroll", true, true, window, 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); testee.dispatchEvent(evt);
}; };

View File

@ -4,7 +4,7 @@
/*global runs, waitsFor, spyOn */ /*global runs, waitsFor, spyOn */
/*global window, eb, loadFixtures, document */ /*global window, eb, loadFixtures, document */
/*global $, _, d3*/ /*global $, _, d3*/
/*global helper, mocks*/ /*global helper, mocks, uiMatchers*/
/*global EventDispatcher, EventDispatcherControls, NodeShaper, EdgeShaper*/ /*global EventDispatcher, EventDispatcherControls, NodeShaper, EdgeShaper*/
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@ -169,35 +169,9 @@
spyOn(nodeShaper, "changeTo").andCallThrough(); spyOn(nodeShaper, "changeTo").andCallThrough();
spyOn(edgeShaper, "changeTo").andCallThrough(); spyOn(edgeShaper, "changeTo").andCallThrough();
uiMatchers.define(this);
this.addMatchers({ 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() { toConformToToolbox: function() {
var box = this.actual, var box = this.actual,
foundActive = false, foundActive = false,
@ -205,10 +179,9 @@
_.each(box.children, function(btn) { _.each(box.children, function(btn) {
expect(btn).toBeTag("button"); expect(btn).toBeTag("button");
expect(btn).toBeOfClass("btn btn-icon"); expect(btn).toBeOfClass("btn btn-icon");
expect(btn.children.length).toEqual(1); expect(btn).toBeOfClass("btn-icon");
expect(btn.firstChild).toBeTag("img"); expect(btn).toBeOfClass("gv-icon-btn");
expect(btn.firstChild).toBeOfClass("gv-icon-btn"); if ($(btn).hasClass("active")) {
if ($(btn.firstChild).hasClass("active")) {
if (foundActive) { if (foundActive) {
failed = true; failed = true;
} else { } else {

View File

@ -214,7 +214,7 @@
}); });
}); });
/*
it('should position the first node in the centre', function() { it('should position the first node in the centre', function() {
runs(function() { runs(function() {
standardConfig.nodes = createNodeList(1); standardConfig.nodes = createNodeList(1);
@ -239,7 +239,7 @@
expect(nodes[0]).toBeCloseToNode(center); expect(nodes[0]).toBeCloseToNode(center);
}); });
}); });
*/
it('should position not linked nodes close to each other', function() { it('should position not linked nodes close to each other', function() {
runs(function() { runs(function() {
nodes = createNodeList(4); nodes = createNodeList(4);
@ -373,7 +373,7 @@
expect(func({ expect(func({
source: {}, source: {},
target: {} target: {}
})).toEqual(config.distance); })).toEqual(2 * config.distance);
}); });
it('should set the gravity', function() { it('should set the gravity', function() {
@ -445,7 +445,7 @@
expect(func({ expect(func({
source: {}, source: {},
target: {} target: {}
})).toEqual(200); })).toEqual(2 * 200);
}); });
it('should be able to switch the gravity', function() { it('should be able to switch the gravity', function() {

View File

@ -374,7 +374,7 @@
expect($("#control_node_list #control_node_labelandcolour")[0]).toConformToListCSS(); expect($("#control_node_list #control_node_labelandcolour")[0]).toConformToListCSS();
helper.simulateMouseEvent("click", "control_node_labelandcolour"); 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"); helper.simulateMouseEvent("click", "control_node_labelandcolour_submit");
expect(shaper.changeTo).toHaveBeenCalledWith({ expect(shaper.changeTo).toHaveBeenCalledWith({

View File

@ -226,7 +226,7 @@ function NodeShaperControls(list, shaper) {
idprefix, [{ idprefix, [{
type: "text", type: "text",
id: "label-attribute", id: "label-attribute",
text: "Vertex label attribute" text: "Vertex label attribute"
},{ },{
type: "decission", type: "decission",
id: "samecolour", id: "samecolour",
@ -240,11 +240,11 @@ function NodeShaperControls(list, shaper) {
text: "Use different attribute for coloring", text: "Use different attribute for coloring",
isDefault: false, isDefault: false,
interior: [ interior: [
{ {
type: "text", type: "text",
id: "colour-attribute", id: "colour-attribute",
text: "Color attribute" text: "Color attribute"
} }
] ]
}], function () { }], function () {
var key = $("#" + idprefix + "label-attribute").attr("value"), var key = $("#" + idprefix + "label-attribute").attr("value"),