1
0
Fork 0

Fixed tests for newest frontend changes

This commit is contained in:
Michael Hackstein 2015-02-02 12:59:41 +01:00
parent 6aca853065
commit 0b44a05a1b
5 changed files with 22 additions and 4 deletions

View File

@ -89,6 +89,10 @@
});
},
isSystem: function() {
return this.get("system");
},
isDevelopment: function() {
return this.get("development");
}

View File

@ -29,7 +29,7 @@
<div class="header_left">
<input type="button" class="open button-success" disabled="true" value="Open" />
<input id="app-switch-mode" type="button" class="switch-mode button-warning" value="<%=app.get('development')?'Production':'Development'%>" />
<input type="button" class="delete button-danger" value="Delete" disabled="<%=app.get('isSystem')%>" />
<input type="button" class="delete button-danger" value="Delete" <%=app.isSystem()?"disabled":""%> />
</div>
<div class="header_right">
<h3>

View File

@ -114,7 +114,7 @@
},
showConfigureDialog: function(e) {
if ((this._appConfig).keys.length === 0) {
if (Object.keys(this._appConfig).length === 0) {
e.stopPropagation();
return;
}

View File

@ -35,7 +35,20 @@
var myFoxx = new window.Foxx();
expect(myFoxx.isNew()).toBeFalsy();
});
it("system apps should know it", function() {
var myFoxx = new window.Foxx({
system: true
});
expect(myFoxx.isSystem()).toBeTruthy();
});
it("non system apps should know it", function() {
var myFoxx = new window.Foxx({
system: false
});
expect(myFoxx.isSystem()).toBeFalsy();
});
describe("mode chages", function() {

View File

@ -65,6 +65,7 @@
});
it("should be able to delete the app", function() {
runs(function() {
deleteButton.click();
});
@ -153,7 +154,7 @@
});
it("the button should be enabled", function() {
expect($(buttonId).prop("disabled")).toEqual(false);
expect($(buttonId).hasClass("disabled")).toEqual(false);
});
it("should utilize a modal dialog", function() {
@ -205,7 +206,7 @@
});
it("the button should be disabled", function() {
expect($(buttonId).prop("disabled")).toEqual(true);
expect($(buttonId).hasClass("disabled")).toEqual(true);
});
});