[Mobile] Tests

Fixed BrowseControllerSpec test
to account for new  call. Now
expects destroy and select-obj calls.
This commit is contained in:
Shivam Dave 2015-08-25 14:20:36 -07:00
parent cd46dab5c1
commit d80c359a86

View File

@ -164,7 +164,12 @@ define(
// lets the html code know if the // lets the html code know if the
// tree menu is open. // tree menu is open.
it("calls the treeSlide function", function () { it("calls the treeSlide function", function () {
mockScope.treeSlide(); expect(mockScope.$on).toHaveBeenCalledWith(
"select-obj",
jasmine.any(Function)
);
mockScope.$on.calls[1].args[1]();
}); });
it("releases its navigation listener when its scope is destroyed", function () { it("releases its navigation listener when its scope is destroyed", function () {
@ -172,7 +177,8 @@ define(
"$destroy", "$destroy",
jasmine.any(Function) jasmine.any(Function)
); );
mockScope.$on.mostRecentCall.args[1]();
mockScope.$on.calls[0].args[1]();
// Should remove the listener it added earlier // Should remove the listener it added earlier
expect(mockNavigationService.removeListener).toHaveBeenCalledWith( expect(mockNavigationService.removeListener).toHaveBeenCalledWith(
mockNavigationService.addListener.mostRecentCall.args[0] mockNavigationService.addListener.mostRecentCall.args[0]