Skip to content

Commit

Permalink
PCHR-4094: Add admin to managees list
Browse files Browse the repository at this point in the history
  • Loading branch information
igorpavlov committed Aug 2, 2018
1 parent 0f6bf79 commit ab37348
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 15 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -828,10 +828,7 @@ define([
// In case of general administration
return Contact.all()
.then(function (contacts) {
vm.managedContacts = _.remove(contacts.list, function (contact) {
// Removes the admin from the list of contacts
return contact.id !== loggedInContact.id;
});
vm.managedContacts = contacts.list;
});
} else {
// In any other case (including managing)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,7 @@

describe('admin opens leave request popup in create mode', function () {
var leaveRequest;
var adminId = '206';
var adminId = CRM.vars.leaveAndAbsences.contactId.toString();

beforeEach(function () {
leaveRequest = LeaveRequestInstance.init();
Expand All @@ -1151,8 +1151,8 @@
expect(controller.isRole('admin')).toBeTruthy();
});

it('does not contain admin in the list of managees', function () {
expect(_.find(controller.managedContacts, { 'id': adminId })).toBeUndefined();
it('contains admin in the list of managees', function () {
expect(!!_.find(controller.managedContacts, { 'id': adminId })).toBe(true);
});
});
});
Expand Down

0 comments on commit ab37348

Please sign in to comment.