Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add group name to add modal. #2925

Merged
merged 2 commits into from
Aug 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,8 @@
}
);
}
vm.$onInit = function () {
vm.groupName = vm.resolve.config.group.name;
};
}
})();
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

describe('Controller: GroupMemberAddModalCtrl', function () {
var ctrl;
var mockGroupName = 'Test Group';
var promise;
var scope;
var service;
Expand All @@ -19,7 +20,7 @@ describe('Controller: GroupMemberAddModalCtrl', function () {
ctrl = $componentController(
'rpGroupMemberAddModal',
{ $scope: scope },
{ resolve: { config: { group: { id: 5 } } } }
{ resolve: { config: { group: { id: 5, name: mockGroupName } } } }
);
}));

Expand All @@ -33,6 +34,12 @@ describe('Controller: GroupMemberAddModalCtrl', function () {
expect(ctrl.form.email).toEqual('');
});

it('GroupName should be initialized', function () {
// when using $componentController, need to call lifecycle hooks
ctrl.$onInit();
expect(ctrl.groupName).toEqual(mockGroupName);
});

it('Helper Methods exist', function () {
expect(angular.isFunction(ctrl.cancel)).toBe(true);
expect(angular.isFunction(ctrl.close)).toBe(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
'<div id="group-member-add-modal"></div>'
);
var scope = $rootScope.$new();
var template = '<rp-group-member-add-modal resolve="{config:{}}">' +
'</rp-group-member-add-modal>';
var template = '<rp-group-member-add-modal resolve="{config:{' +
'group:{name:TestGroup}}}"></rp-group-member-add-modal>';
directiveElement = $compile(template)(scope);
scope.$digest();
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ <h3 class="modal-title">
</div>
<div class="modal-body">
<div class="row">
<p class="p-l-1-2">
<strong>{{ $ctrl.groupName }}</strong>
</p>
<form
ng-submit="$ctrl.sendInvite()"
name="inviteNewMemberForm"
Expand Down