mirror of
https://github.com/VinylDNS/vinyldns
synced 2025-08-31 14:25:30 +00:00
Fix portal tests
This commit is contained in:
@@ -57,7 +57,7 @@ describe('Controller: GroupsController', function () {
|
||||
groups: "all my groups"
|
||||
}
|
||||
};
|
||||
var getGroups = spyOn(this.groupsService, 'getGroups')
|
||||
var getGroups = spyOn(this.groupsService, 'getGroupsAbridged')
|
||||
.and.stub()
|
||||
.and.returnValue(this.q.when(response));
|
||||
|
||||
|
@@ -55,6 +55,9 @@ angular.module('controller.zones', [])
|
||||
|
||||
groupsService.getGroupsAbridged(true, "").then(function (results) {
|
||||
if (results.data) {
|
||||
// Get all groups where the group members include the current user
|
||||
$scope.myGroups = results.data.groups.filter(grp => grp.members.findIndex(mem => mem.id === $scope.profile.id) >= 0);
|
||||
$scope.myGroupIds = $scope.myGroups.map(grp => grp.id);
|
||||
$scope.allGroups = results.data.groups;
|
||||
}
|
||||
$scope.resetCurrentZone();
|
||||
|
@@ -37,12 +37,12 @@ describe('Controller: ZonesController', function () {
|
||||
this.scope.zones = {};
|
||||
|
||||
profileService.getAuthenticatedUserData = function() {
|
||||
return $q.when({data: {}});
|
||||
return $q.when({data: {id: "userId"}});
|
||||
};
|
||||
groupsService.getGroups = function() {
|
||||
groupsService.getGroupsAbridged = function () {
|
||||
return $q.when({
|
||||
data: {
|
||||
groups: [{id: "all my groups"}]
|
||||
groups: [{id: "all my groups", members: [{id: "userId"}]}]
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -65,7 +65,7 @@ describe('Controller: ZonesController', function () {
|
||||
|
||||
it('test that we properly get users groups when loading ZonesController', function(){
|
||||
this.scope.$digest();
|
||||
expect(this.scope.myGroups).toEqual([{id: "all my groups"}]);
|
||||
expect(this.scope.myGroups).toEqual([{id: "all my groups", members: [{id: "userId"}]}]);
|
||||
});
|
||||
|
||||
it('nextPageMyZones should call getZones with the correct parameters', function () {
|
||||
|
Reference in New Issue
Block a user