Commit 03006614 authored by Robert Knight's avatar Robert Knight

Split the group focused / session state changed handling into two tests

It is likely that we will want to handle these events differently in
future, so split them into two separate tests.
parent 7812d163
...@@ -132,11 +132,14 @@ describe 'AppController', -> ...@@ -132,11 +132,14 @@ describe 'AppController', ->
createController() createController()
assert.isFalse($scope.shareDialog.visible) assert.isFalse($scope.shareDialog.visible)
it 'calls $route.reload() when the session state changes', -> it 'reloads the view when the focused group changes', ->
createController() createController()
groupEvents = [events.SESSION_CHANGED, events.GROUP_FOCUSED];
groupEvents.forEach((event) ->
fakeRoute.reload = sinon.spy() fakeRoute.reload = sinon.spy()
$scope.$broadcast(event) $scope.$broadcast(events.GROUP_FOCUSED)
assert.calledOnce(fakeRoute.reload)
it 'reloads the view when the session state changes', ->
createController()
fakeRoute.reload = sinon.spy()
$scope.$broadcast(events.SESSION_CHANGED)
assert.calledOnce(fakeRoute.reload) assert.calledOnce(fakeRoute.reload)
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment