Skip to content

Commit

Permalink
fix e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
dianabarsan committed Jul 26, 2023
1 parent f78fb3e commit f4f719d
Showing 1 changed file with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,22 @@ const newRole = 'new_chw';

const addRole = async (role = newRole) => {
const settings = await utils.getSettings();
settings.roles[role] = { ...settings.roles.chw };
settings.roles[role] = { name: newRole, offline: true };
Object.values(settings.permissions).forEach(roles => {
if (roles.includes('chw')) {
roles.push(newRole);
}
});
await utils.updateSettings(settings, true);
};

const username = uuid();
const user = {
_id: `org.couchdb.user:${username}`,
type: 'user',
username: username,
password: uuid(),
facility_id: clinic._id,
contact_id: contact._id,
roles: [ newRole ]
place: clinic._id,
contact: contact._id,
roles: [newRole]
};

describe('Database access for new roles', () => {
Expand All @@ -60,7 +64,7 @@ describe('Database access for new roles', () => {
await browserDbUtils.createDoc(report);
await commonPage.sync();

await utils.get(report._id);
await utils.getDoc(report._id);
});

it('should be able to sync documents down', async () => {
Expand Down

1 comment on commit f4f719d

@fardarter
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this.

Please sign in to comment.