-
-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(#9547): require password reset on first time login and admin pas…
…sword update (#9731)
- Loading branch information
1 parent
8e6ed11
commit 67b5330
Showing
42 changed files
with
1,449 additions
and
201 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,7 @@ describe('EditUserCtrl controller', () => { | |
}, | ||
permissions: { | ||
can_have_multiple_places: ['community-health-assistant'], | ||
can_skip_password_change: ['community-health-assistant'], | ||
}, | ||
}); | ||
http = { get: sinon.stub() }; | ||
|
@@ -864,4 +865,37 @@ describe('EditUserCtrl controller', () => { | |
}); | ||
}); | ||
}); | ||
|
||
describe('skipPasswordChange', () => { | ||
let user; | ||
|
||
beforeEach(() => { | ||
user = { | ||
_id: 'user.id', | ||
name: 'user.name', | ||
fullname: 'user.fullname', | ||
email: '[email protected]', | ||
phone: 'user.phone', | ||
facility_id: 'abc', | ||
contact_id: 'xyz', | ||
language: 'zz', | ||
}; | ||
}); | ||
|
||
it('should set skipPasswordChange to false if user does not have can_skip_password_change permission', () => { | ||
user.roles = ['supervisor']; | ||
|
||
return mockEditAUser(user).setupPromise.then(() => { | ||
chai.expect(scope.skipPasswordChange).to.equal(false); | ||
}); | ||
}); | ||
|
||
it('should set skipPasswordChange to true if user has can_skip_password_change permission', () => { | ||
user.roles = ['community-health-assistant']; | ||
|
||
return mockEditAUser(user).setupPromise.then(() => { | ||
chai.expect(scope.skipPasswordChange).to.equal(true); | ||
}); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.