1
0
Fork 0

Added test for graph deletion confirmation

This commit is contained in:
Michael Hackstein 2014-01-30 17:13:23 +01:00
parent 54346784ca
commit a51979818a
4 changed files with 29 additions and 8 deletions

View File

@ -22,7 +22,7 @@
success: function() {
self.hide();
},
error: function() {
error: function(xhr, err) {
var response = JSON.parse(err.responseText),
msg = response.errorMessage;
arangoHelper.arangoError(msg);

View File

@ -167,6 +167,7 @@ module.exports = function(karma) {
'frontend/js/views/graphView.js',
'frontend/js/views/graphManagementView.js',
'frontend/js/views/addNewGraphView.js',
'frontend/js/views/deleteGraphView.js',
'frontend/js/views/dbSelectionView.js',
'frontend/js/views/editListEntryView.js',
'frontend/js/views/loginView.js',

View File

@ -243,6 +243,7 @@
"shell",
"graphManagement",
"graphManagement/add",
"graphManagement/delete/:name",
"applications",
"applications/installed",
"applications/available"
@ -373,6 +374,24 @@
);
});
it("should offer the delete graph view", function() {
var name = "testGraph";
simpleNavigationCheck(
{
url: "graphManagement/delete/:name",
params: [name]
},
"DeleteGraphView",
"graphviewer-menu",
{
collection: graphsDummy
},
{
render: name
}
);
});
it("should route to the applications tab", function() {
simpleNavigationCheck(
"applications",

View File

@ -95,15 +95,16 @@
});
it("should be able to delete", function() {
it("should navigate to graph delete view", function() {
spyOn(window.App, "navigate");
var lg = graphs.get("g3");
spyOn(lg, "destroy").andCallFake(function(opt) {
opt.success();
});
spyOn(view, "render");
$("#" + g3._key + " > span").click();
expect(lg.destroy).toHaveBeenCalled();
expect(view.render).toHaveBeenCalled();
expect(window.App.navigate).toHaveBeenCalledWith(
"graphManagement/delete/" + g3._key,
{
trigger: true
}
);
});
});