1
0
Fork 0

Added tests for the open app button

This commit is contained in:
Michael Hackstein 2015-01-29 15:20:16 +01:00
parent 6bcce430ae
commit 368f78cda1
2 changed files with 24 additions and 4 deletions

View File

@ -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">

View File

@ -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() {