From d80c359a8639ca573850da60b14a88cdff55f9fd Mon Sep 17 00:00:00 2001 From: Shivam Dave Date: Tue, 25 Aug 2015 14:20:36 -0700 Subject: [PATCH] [Mobile] Tests Fixed BrowseControllerSpec test to account for new call. Now expects destroy and select-obj calls. --- platform/commonUI/browse/test/BrowseControllerSpec.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/platform/commonUI/browse/test/BrowseControllerSpec.js b/platform/commonUI/browse/test/BrowseControllerSpec.js index 722b7b4132..136b44cd30 100644 --- a/platform/commonUI/browse/test/BrowseControllerSpec.js +++ b/platform/commonUI/browse/test/BrowseControllerSpec.js @@ -164,7 +164,12 @@ define( // lets the html code know if the // tree menu is open. 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 () { @@ -172,7 +177,8 @@ define( "$destroy", jasmine.any(Function) ); - mockScope.$on.mostRecentCall.args[1](); + + mockScope.$on.calls[0].args[1](); // Should remove the listener it added earlier expect(mockNavigationService.removeListener).toHaveBeenCalledWith( mockNavigationService.addListener.mostRecentCall.args[0]