mirror of https://gitee.com/bigwinds/arangodb
Added tests for the open app button
This commit is contained in:
parent
6bcce430ae
commit
368f78cda1
|
@ -38,7 +38,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="swagger">
|
||||
<iframe src="/_db/<%= app.attributes.db%>/_admin/aardvark/standalone.html#application/documentation/<%= app.encodedMount() %>" name="Documentation"></iframe>
|
||||
<iframe src="/_db/<%= app.attributes.db%>/_admin/aardvark/standalone.html#application/documentation/<%= encodeURIComponent(app.encodedMount()) %>" name="Documentation"></iframe>
|
||||
</div>
|
||||
</section>
|
||||
<aside class="meta">
|
||||
|
|
|
@ -8,9 +8,14 @@
|
|||
|
||||
describe("Application Details View", function() {
|
||||
|
||||
var div, view, appDummy, deleteButton, openButton, modalDiv;
|
||||
var div, view, appDummy, deleteButton, openButton, modalDiv, getDummy;
|
||||
|
||||
beforeEach(function() {
|
||||
getDummy = {
|
||||
success: function(callback) {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
spyOn(arangoHelper, "currentDatabase").andReturn("_system");
|
||||
modalDiv = document.createElement("div");
|
||||
modalDiv.id = "modalPlaceholder";
|
||||
|
@ -34,6 +39,10 @@
|
|||
view = new window.ApplicationDetailView({
|
||||
model: appDummy
|
||||
});
|
||||
spyOn($, "get").andCallFake(function(url) {
|
||||
expect(url).toEqual(view.appUrl());
|
||||
return getDummy;
|
||||
});
|
||||
view.render();
|
||||
deleteButton = $("input.delete");
|
||||
openButton = $("input.open");
|
||||
|
@ -83,13 +92,24 @@
|
|||
});
|
||||
|
||||
it("should be able to open the main route if exists", function() {
|
||||
expect(true).toBeFalsy();
|
||||
getDummy.success = function(callback) {
|
||||
// App url is reachable.
|
||||
callback();
|
||||
};
|
||||
view.render();
|
||||
expect($("input.open").prop("disabled")).toBeFalsy();
|
||||
});
|
||||
|
||||
it("should be disable open if the main route does not exists", function() {
|
||||
expect(true).toBeFalsy();
|
||||
getDummy.success = function() {
|
||||
// App url is not reachable.
|
||||
return;
|
||||
};
|
||||
view.render();
|
||||
expect($("input.open").prop("disabled")).toBeTruthy();
|
||||
});
|
||||
|
||||
|
||||
/*
|
||||
describe("edit a foxx", function() {
|
||||
|
||||
|
|
Loading…
Reference in New Issue