Skip to content

Commit

Permalink
chore: update test
Browse files Browse the repository at this point in the history
  • Loading branch information
Benmuiruri committed Jun 10, 2024
1 parent e9ddada commit 43a970b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions admin/tests/unit/controllers/edit-user.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ describe('EditUserCtrl controller', () => {
let mockEditCurrentUser;
let scope;
let dbGet;
let dbAllDocs;
let UpdateUser;
let CreateUser;
let UserSettings;
Expand All @@ -21,6 +22,7 @@ describe('EditUserCtrl controller', () => {
module('adminApp');

dbGet = sinon.stub();
dbAllDocs = sinon.stub();
UpdateUser = sinon.stub().resolves();
CreateUser = {
createSingleUser: sinon.stub().resolves()
Expand Down Expand Up @@ -68,6 +70,7 @@ describe('EditUserCtrl controller', () => {
'DB',
KarmaUtils.mockDB({
get: dbGet,
allDocs: dbAllDocs,
})
);
$provide.value('UpdateUser', UpdateUser);
Expand Down Expand Up @@ -427,6 +430,13 @@ describe('EditUserCtrl controller', () => {
data: { total_docs: 20000, warn_docs: 800, warn: false, limit: 10000 },
});

dbAllDocs.resolves({
rows: [
{ doc: { _id: 'facility_id' } },
{ doc: { _id: 'facility_id_2' } },
],
});

return mockEditAUser(userToEdit)
.setupPromise.then(() => {
scope.editUserModel.fullname = 'fullname';
Expand Down

0 comments on commit 43a970b

Please sign in to comment.