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() {
|
||||
self.hide();
|
||||
},
|
||||
error: function() {
|
||||
error: function(xhr, err) {
|
||||
var response = JSON.parse(err.responseText),
|
||||
msg = response.errorMessage;
|
||||
arangoHelper.arangoError(msg);
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue