Skip to content

Commit

Permalink
Merge pull request #2511 from civicrm/staging
Browse files Browse the repository at this point in the history
Sync master with staging
  • Loading branch information
davialexandre authored Feb 28, 2018
2 parents cdb688d + 6f3561b commit 9ce9bac
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 9 deletions.
6 changes: 5 additions & 1 deletion bin/drush-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ CIVI_PATH=$1
shift

set -ex
drush "$@" cvapi extension.install keys=$CORE_EXTS,$ENTITY_EXTS,$APP_EXTS
drush "$@" cvapi extension.install keys=$CORE_EXTS
drush cvapi Extension.refresh
drush "$@" cvapi extension.install keys=$ENTITY_EXTS
drush cvapi Extension.refresh
drush "$@" cvapi extension.install keys=$APP_EXTS
set +ex

if [ "$WITH_HR_SAMPLE" == "1" ]; then
Expand Down

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 @@ -443,6 +443,7 @@ define([
*/
function initAfterContactSelection () {
vm.postContactSelection = true;
vm.staffMemberSelectionComplete = false;

// when manager deselects contact it is called without a selected contact_id
if (!vm.request.contact_id) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,27 @@
expect(AbsenceTypeAPI.all).not.toHaveBeenCalled();
});

describe('before contact is selected', function () {
it('sets post contact selection as false', function () {
expect(controller.postContactSelection).toBe(false);
});

it('sets staff member selection as false', function () {
expect(controller.staffMemberSelectionComplete).toBe(false);
});
});

describe('after contact is selected', function () {
describe('when loading entitlements for the staff', function () {
beforeEach(function () {
controller.initAfterContactSelection();
});

it('sets post contact selection as true', function () {
expect(controller.postContactSelection).toBe(true);
});
});

describe('when entitlement is present', function () {
var approvalStatus;

Expand All @@ -817,6 +837,14 @@
expect(controller.newStatusOnSave).toEqual(approvalStatus);
});

it('sets post contact selection back to false', function () {
expect(controller.postContactSelection).toBe(false);
});

it('sets staff member selection as true', function () {
expect(controller.staffMemberSelectionComplete).toBe(true);
});

describe('cancelled status', function () {
var cancelStatus, availableStatuses;

Expand All @@ -829,6 +857,30 @@
expect(availableStatuses).not.toContain(cancelStatus);
});
});

describe('and then select a staff without entitlements', function () {
beforeEach(function () {
EntitlementAPI.all.and.returnValue($q.resolve([]));
controller.initAfterContactSelection();
$scope.$digest();
});

it('sets staff member selection complete as false', function () {
expect(controller.staffMemberSelectionComplete).toBe(false);
});
});
});

describe('when no entitlements are present', function () {
beforeEach(function () {
EntitlementAPI.all.and.returnValue($q.resolve([]));
controller.initAfterContactSelection();
$scope.$digest();
});

it('sets staff member selection complete as false', function () {
expect(controller.staffMemberSelectionComplete).toBe(false);
});
});
});

Expand Down

0 comments on commit 9ce9bac

Please sign in to comment.