[Mobile] CleanUp/Tests

Added tests inside spec files
for the QueryService, TreeNodeController,
and InfoGesture. Also cleaned up the
tree so that padding is used between
buttons instead of margins.
This commit is contained in:
Shivam Dave
2015-07-23 13:19:58 -07:00
parent b3bc8b6876
commit 143e3eeb6c
8 changed files with 31 additions and 18 deletions

View File

@ -29,6 +29,7 @@ define(
describe("The tree node controller", function () {
var mockScope,
mockTimeout,
mockQueryService,
controller;
function TestObject(id, context) {
@ -43,7 +44,8 @@ define(
beforeEach(function () {
mockScope = jasmine.createSpyObj("$scope", ["$watch", "$on"]);
mockTimeout = jasmine.createSpy("$timeout");
controller = new TreeNodeController(mockScope, mockTimeout);
mockQueryService = jasmine.createSpyObj("queryService", ["isMobile"]);
controller = new TreeNodeController(mockScope, mockTimeout, mockQueryService);
});
it("allows tracking of expansion state", function () {
@ -183,6 +185,10 @@ define(
expect(controller.isSelected()).toBeFalsy();
});
it("check if tree node is in a mobile device", function () {
controller.checkMobile();
});
});
}
);