mirror of https://gitee.com/bigwinds/arangodb
Adapted karma tests to use the combined file generated via grunt instead of a self concatenated file. The test is now much closer to reality and the files are not stored redundantly
This commit is contained in:
parent
0516be7f64
commit
e32f1ea081
|
@ -102,7 +102,7 @@
|
||||||
|
|
||||||
createModalHotkeys: function() {
|
createModalHotkeys: function() {
|
||||||
//submit modal
|
//submit modal
|
||||||
$(this.el).bind('keydown', 'ctrl+return', function(){
|
$(this.el).bind('keydown', 'return', function(){
|
||||||
$('.modal-footer .button-success').click();
|
$('.modal-footer .button-success').click();
|
||||||
});
|
});
|
||||||
$("input", $(this.el)).bind('keydown', 'return', function(){
|
$("input", $(this.el)).bind('keydown', 'return', function(){
|
||||||
|
|
|
@ -130,7 +130,7 @@
|
||||||
|
|
||||||
"app.js": {
|
"app.js": {
|
||||||
"files": [
|
"files": [
|
||||||
"frontend/build/app.min.js"
|
"frontend/build/app.js"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -87,9 +87,6 @@
|
||||||
"test/specs/views/shellViewSpec.js",
|
"test/specs/views/shellViewSpec.js",
|
||||||
"test/specs/views/userManagementViewSpec.js",
|
"test/specs/views/userManagementViewSpec.js",
|
||||||
|
|
||||||
"test/specs/router/routerSpec.js",
|
|
||||||
"test/specs/router/clusterRouterSpec.js",
|
|
||||||
|
|
||||||
"test/specs/router/routerSpec.js",
|
"test/specs/router/routerSpec.js",
|
||||||
|
|
||||||
"test/specs/router/versionCheckSpec.js"
|
"test/specs/router/versionCheckSpec.js"
|
||||||
|
|
|
@ -421,6 +421,7 @@
|
||||||
buttons = [],
|
buttons = [],
|
||||||
cbs = {
|
cbs = {
|
||||||
callback: function () {
|
callback: function () {
|
||||||
|
throw "Should by a spy";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
btn,
|
btn,
|
||||||
|
@ -429,17 +430,18 @@
|
||||||
e.which = 13;
|
e.which = 13;
|
||||||
e.keyCode = 13;
|
e.keyCode = 13;
|
||||||
|
|
||||||
spyOn(cbs, "callback").andCallThrough();
|
spyOn(cbs, "callback");
|
||||||
btnObj = testee.createSuccessButton(title, cbs.callback);
|
btnObj = testee.createSuccessButton(title, cbs.callback);
|
||||||
buttons.push(btnObj);
|
buttons.push(btnObj);
|
||||||
testShow(buttons);
|
testShow(buttons);
|
||||||
btn = $(".button-" + btnObj.type, $(div));
|
btn = $(".button-" + btnObj.type, $(div));
|
||||||
|
|
||||||
|
|
||||||
spyOn($.fn, "click");
|
spyOn($.fn, "click").andCallThrough();
|
||||||
$(testee.el).trigger(e);
|
$(testee.el).trigger(e);
|
||||||
|
|
||||||
expect($.fn.click).toHaveBeenCalled();
|
expect($.fn.click).toHaveBeenCalled();
|
||||||
|
expect(cbs.callback).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should call function bind function for view.el input", function () {
|
it("should call function bind function for view.el input", function () {
|
||||||
|
@ -447,8 +449,10 @@
|
||||||
btnObj = {},
|
btnObj = {},
|
||||||
title = "Save",
|
title = "Save",
|
||||||
buttons = [],
|
buttons = [],
|
||||||
|
textField = [],
|
||||||
cbs = {
|
cbs = {
|
||||||
callback: function () {
|
callback: function () {
|
||||||
|
throw "Should be a spy";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
btn,
|
btn,
|
||||||
|
@ -458,19 +462,22 @@
|
||||||
|
|
||||||
testee.enabledHotkey = false;
|
testee.enabledHotkey = false;
|
||||||
|
|
||||||
spyOn(cbs, "callback").andCallThrough();
|
spyOn(cbs, "callback");
|
||||||
btnObj = testee.createSuccessButton(title, cbs.callback);
|
btnObj = testee.createSuccessButton(title, cbs.callback);
|
||||||
buttons.push(btnObj);
|
buttons.push(btnObj);
|
||||||
|
textField.push(
|
||||||
|
testee.createTextEntry("dontcare", "ABC", "asd")
|
||||||
|
);
|
||||||
|
|
||||||
testShow(buttons);
|
testShow(buttons, textField);
|
||||||
$('.modal-body').html('<input type="text" id="dontcare" value="asd">ABC</input>');
|
|
||||||
|
|
||||||
btn = $(".button-" + btnObj.type, $(div));
|
btn = $(".button-" + btnObj.type, $(div));
|
||||||
|
|
||||||
spyOn($.fn, "click");
|
spyOn($.fn, "click").andCallThrough();
|
||||||
$("input").trigger(e);
|
$("#dontcare").trigger(e);
|
||||||
|
|
||||||
expect($.fn.click).toHaveBeenCalled();
|
expect($.fn.click).toHaveBeenCalled();
|
||||||
|
expect(cbs.callback).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should call function bind function for view.el select", function () {
|
it("should call function bind function for view.el select", function () {
|
||||||
|
@ -478,8 +485,10 @@
|
||||||
btnObj = {},
|
btnObj = {},
|
||||||
title = "Save",
|
title = "Save",
|
||||||
buttons = [],
|
buttons = [],
|
||||||
|
select = [],
|
||||||
cbs = {
|
cbs = {
|
||||||
callback: function () {
|
callback: function () {
|
||||||
|
throw "Should be a spy";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
btn,
|
btn,
|
||||||
|
@ -489,19 +498,25 @@
|
||||||
|
|
||||||
|
|
||||||
testee.enabledHotkey = false;
|
testee.enabledHotkey = false;
|
||||||
spyOn(cbs, "callback").andCallThrough();
|
spyOn(cbs, "callback");
|
||||||
btnObj = testee.createSuccessButton(title, cbs.callback);
|
btnObj = testee.createSuccessButton(title, cbs.callback);
|
||||||
buttons.push(btnObj);
|
buttons.push(btnObj);
|
||||||
|
|
||||||
|
select.push(
|
||||||
|
testee.createSelectEntry("dontcare", "Choose", false, undefined,
|
||||||
|
testee.createOptionEntry("option1")
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
testShow(buttons);
|
testShow(buttons, select);
|
||||||
$('.modal-body').html('<select name="top5" size="3"><option>Heino</option></select>');
|
|
||||||
|
|
||||||
btn = $(".button-" + btnObj.type, $(div));
|
btn = $(".button-" + btnObj.type, $(div));
|
||||||
|
|
||||||
spyOn($.fn, "click");
|
spyOn($.fn, "click").andCallThrough();
|
||||||
$("select").trigger(e);
|
$("select").trigger(e);
|
||||||
|
|
||||||
expect($.fn.click).toHaveBeenCalled();
|
expect($.fn.click).toHaveBeenCalled();
|
||||||
|
expect(cbs.callback).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
/*it("test focused button navigation (direction right)", function() {
|
/*it("test focused button navigation (direction right)", function() {
|
||||||
|
|
|
@ -33,8 +33,6 @@
|
||||||
"frontend/js/lib/jquery.uploadfile.js",
|
"frontend/js/lib/jquery.uploadfile.js",
|
||||||
"frontend/js/lib/select2.min.js",
|
"frontend/js/lib/select2.min.js",
|
||||||
"frontend/js/lib/handlebars-1.0.rc.1.js",
|
"frontend/js/lib/handlebars-1.0.rc.1.js",
|
||||||
"frontend/js/lib/underscore.js",
|
|
||||||
"frontend/js/lib/backbone.js",
|
|
||||||
"frontend/js/lib/jsoneditor-min.js",
|
"frontend/js/lib/jsoneditor-min.js",
|
||||||
"frontend/js/lib/d3.v3.min.js",
|
"frontend/js/lib/d3.v3.min.js",
|
||||||
"frontend/js/lib/nv.d3.js",
|
"frontend/js/lib/nv.d3.js",
|
||||||
|
@ -50,17 +48,19 @@
|
||||||
"frontend/js/lib/md5.js",
|
"frontend/js/lib/md5.js",
|
||||||
"frontend/src/ace.js"
|
"frontend/src/ace.js"
|
||||||
],
|
],
|
||||||
js: [
|
graphViewer: [
|
||||||
"frontend/js/graphViewer/graph/*",
|
"frontend/js/graphViewer/graph/*",
|
||||||
"frontend/js/graphViewer/ui/*",
|
"frontend/js/graphViewer/ui/*",
|
||||||
"frontend/js/graphViewer/graphViewer.js",
|
"frontend/js/graphViewer/graphViewer.js"
|
||||||
|
],
|
||||||
|
modules: [
|
||||||
|
"frontend/js/arango/arango.js",
|
||||||
"frontend/js/arango/templateEngine.js",
|
"frontend/js/arango/templateEngine.js",
|
||||||
"frontend/js/shell/browser.js",
|
"frontend/js/shell/browser.js",
|
||||||
"frontend/js/config/dygraphConfig.js",
|
"frontend/js/config/dygraphConfig.js",
|
||||||
"frontend/js/modules/underscore.js",
|
"frontend/js/modules/underscore.js",
|
||||||
"frontend/js/modules/org/arangodb/aql/functions.js",
|
"frontend/js/modules/org/arangodb/aql/functions.js",
|
||||||
"frontend/js/modules/org/arangodb/graph/traversal.js",
|
"frontend/js/modules/org/arangodb/graph/traversal.js",
|
||||||
"frontend/js/modules/org/arangodb/.js",
|
|
||||||
"frontend/js/modules/org/arangodb/arango-collection-common.js",
|
"frontend/js/modules/org/arangodb/arango-collection-common.js",
|
||||||
"frontend/js/modules/org/arangodb/arango-collection.js",
|
"frontend/js/modules/org/arangodb/arango-collection.js",
|
||||||
"frontend/js/modules/org/arangodb/arango-database.js",
|
"frontend/js/modules/org/arangodb/arango-database.js",
|
||||||
|
@ -85,8 +85,9 @@
|
||||||
"frontend/js/bootstrap/module-internal.js",
|
"frontend/js/bootstrap/module-internal.js",
|
||||||
"frontend/js/client/bootstrap/module-internal.js",
|
"frontend/js/client/bootstrap/module-internal.js",
|
||||||
"frontend/js/client/client.js",
|
"frontend/js/client/client.js",
|
||||||
"frontend/js/bootstrap/module-console.js",
|
"frontend/js/bootstrap/module-console.js"
|
||||||
"frontend/js/arango/arango.js",
|
],
|
||||||
|
js: [
|
||||||
"frontend/js/models/*",
|
"frontend/js/models/*",
|
||||||
"frontend/js/collections/*",
|
"frontend/js/collections/*",
|
||||||
"frontend/js/views/*",
|
"frontend/js/views/*",
|
||||||
|
@ -133,7 +134,8 @@
|
||||||
'frontend/build/app.js': [
|
'frontend/build/app.js': [
|
||||||
'<%=project.shared.lib %>',
|
'<%=project.shared.lib %>',
|
||||||
'<%=project.standalone.lib %>',
|
'<%=project.standalone.lib %>',
|
||||||
|
'<%=project.standalone.graphViewer %>',
|
||||||
|
'<%=project.standalone.modules %>',
|
||||||
'<%=project.standalone.js %>'
|
'<%=project.standalone.js %>'
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -147,6 +149,15 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
jshint: {
|
||||||
|
options: {
|
||||||
|
laxbreak: true
|
||||||
|
},
|
||||||
|
default: [
|
||||||
|
'<%=project.standalone.js %>'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
uglify: {
|
uglify: {
|
||||||
dist: {
|
dist: {
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"grunt": "^0.4.5",
|
"grunt": "^0.4.5",
|
||||||
"grunt-concat-in-order": "^0.1.6",
|
"grunt-concat-in-order": "^0.1.6",
|
||||||
|
"grunt-contrib-jshint": "^0.11.0",
|
||||||
"grunt-contrib-sass": "^0.8.1",
|
"grunt-contrib-sass": "^0.8.1",
|
||||||
"grunt-contrib-uglify": "^0.7.0",
|
"grunt-contrib-uglify": "^0.7.0",
|
||||||
"grunt-contrib-watch": "^0.6.1",
|
"grunt-contrib-watch": "^0.6.1",
|
||||||
|
|
Loading…
Reference in New Issue