mirror of https://gitee.com/bigwinds/arangodb
Added test for graph deletion confirmation
This commit is contained in:
parent
54346784ca
commit
a51979818a
|
@ -22,7 +22,7 @@
|
||||||
success: function() {
|
success: function() {
|
||||||
self.hide();
|
self.hide();
|
||||||
},
|
},
|
||||||
error: function() {
|
error: function(xhr, err) {
|
||||||
var response = JSON.parse(err.responseText),
|
var response = JSON.parse(err.responseText),
|
||||||
msg = response.errorMessage;
|
msg = response.errorMessage;
|
||||||
arangoHelper.arangoError(msg);
|
arangoHelper.arangoError(msg);
|
||||||
|
|
|
@ -167,6 +167,7 @@ module.exports = function(karma) {
|
||||||
'frontend/js/views/graphView.js',
|
'frontend/js/views/graphView.js',
|
||||||
'frontend/js/views/graphManagementView.js',
|
'frontend/js/views/graphManagementView.js',
|
||||||
'frontend/js/views/addNewGraphView.js',
|
'frontend/js/views/addNewGraphView.js',
|
||||||
|
'frontend/js/views/deleteGraphView.js',
|
||||||
'frontend/js/views/dbSelectionView.js',
|
'frontend/js/views/dbSelectionView.js',
|
||||||
'frontend/js/views/editListEntryView.js',
|
'frontend/js/views/editListEntryView.js',
|
||||||
'frontend/js/views/loginView.js',
|
'frontend/js/views/loginView.js',
|
||||||
|
|
|
@ -243,6 +243,7 @@
|
||||||
"shell",
|
"shell",
|
||||||
"graphManagement",
|
"graphManagement",
|
||||||
"graphManagement/add",
|
"graphManagement/add",
|
||||||
|
"graphManagement/delete/:name",
|
||||||
"applications",
|
"applications",
|
||||||
"applications/installed",
|
"applications/installed",
|
||||||
"applications/available"
|
"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() {
|
it("should route to the applications tab", function() {
|
||||||
simpleNavigationCheck(
|
simpleNavigationCheck(
|
||||||
"applications",
|
"applications",
|
||||||
|
|
|
@ -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");
|
var lg = graphs.get("g3");
|
||||||
spyOn(lg, "destroy").andCallFake(function(opt) {
|
|
||||||
opt.success();
|
|
||||||
});
|
|
||||||
spyOn(view, "render");
|
|
||||||
$("#" + g3._key + " > span").click();
|
$("#" + g3._key + " > span").click();
|
||||||
expect(lg.destroy).toHaveBeenCalled();
|
expect(window.App.navigate).toHaveBeenCalledWith(
|
||||||
expect(view.render).toHaveBeenCalled();
|
"graphManagement/delete/" + g3._key,
|
||||||
|
{
|
||||||
|
trigger: true
|
||||||
|
}
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue