-
-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Co-authored-by: latin-panda <[email protected]>
- Loading branch information
1 parent
8ed110d
commit 7bcb375
Showing
6 changed files
with
49 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ describe('EditUserCtrl controller', () => { | |
let Translate; | ||
let Settings; | ||
let userToEdit; | ||
let user; | ||
let http; | ||
|
||
beforeEach(() => { | ||
|
@@ -178,6 +179,27 @@ describe('EditUserCtrl controller', () => { | |
}); | ||
}); | ||
|
||
describe('Initializing existing users', () => { | ||
user = { | ||
_id: 'user.id', | ||
name: 'user.name', | ||
fullname: 'user.fullname', | ||
email: '[email protected]', | ||
phone: 'user.phone', | ||
facility_id: 'abc', | ||
contact_id: 'xyz', | ||
roles: ['supervisor'], | ||
language: 'zz', | ||
}; | ||
|
||
it('converts string facility_id to Array ', () => { | ||
return mockEditAUser(user).setupPromise.then(() => { | ||
chai.expect(scope.editUserModel.facilitySelect).to.deep.equal(['abc']); | ||
chai.expect(scope.editUserModel.facilitySelect).to.be.an('array'); | ||
}); | ||
}); | ||
}); | ||
|
||
describe('$scope.editUser', () => { | ||
it('username must be present', () => { | ||
return mockEditAUser(userToEdit) | ||
|
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