Commit c6975968 authored by Nick Stenning's avatar Nick Stenning

Merge pull request #2688 from robertknight/groups_changed_exception

Fix exception when GROUPS_CHANGED event is broadcast during route load
parents 37892b94 e30dffdd
......@@ -32,9 +32,6 @@ function GroupListController($scope, $window, groups) {
$scope.focusGroup = function (groupId) {
groups.focus(groupId);
}
$scope.$on(events.GROUPS_CHANGED, $scope.$apply.bind($scope));
$scope.$on(events.GROUP_FOCUSED, $scope.$apply.bind($scope));
}
/**
......
......@@ -165,20 +165,4 @@ describe('groupList', function () {
clickLeaveIcon(element, true);
assert.notCalled(fakeGroups.focus);
});
it('should update when a GROUPS_CHANGED event is received', function () {
var element = createGroupList();
var groupItems = element.find('.group-item');
assert.equal(groupItems.length, groups.length + 1);
groups.push({
id: 'new-group',
name: 'New Group',
url: GROUP_LINK
});
$rootScope.$broadcast(events.GROUPS_CHANGED);
element.scope.$digest();
groupItems = element.find('.group-item');
assert.equal(groupItems.length, groups.length + 1);
});
});
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