Skip to content

Commit

Permalink
Fix eslint lengths
Browse files Browse the repository at this point in the history
  • Loading branch information
Maria Lorena Rodriguez Viruel authored and Maria Lorena Rodriguez Viruel committed Aug 19, 2024
1 parent 28feb4f commit 231e313
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 15 deletions.
5 changes: 4 additions & 1 deletion tests/e2e/default/contacts/contact-details.wdio-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ describe('Contact details page.', () => {
removePermissions.forEach(permission => {
settings.permissions[permission] = settings.permissions[permission].filter(r => r !== roleValue);
});
await utils.updateSettings({ roles: settings.roles, permissions: settings.permissions }, { revert: true, ignoreReload: true });
await utils.updateSettings(
{ roles: settings.roles, permissions: settings.permissions },
{ revert: true, ignoreReload: true }
);

};

Expand Down
5 changes: 4 additions & 1 deletion tests/e2e/default/targets/target-aggregates.wdio-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,10 @@ describe('Target aggregates', () => {
const expectedTargets = targetAggregatesConfig.EXPECTED_TARGETS_NO_PROGRESS;

await utils.saveDocs(targetDocs);
await helperFunctions.updateAggregateTargetsSettings(targetAggregatesConfig.TARGETS_DEFAULT_CONFIG, userWithManyPlaces);
await helperFunctions.updateAggregateTargetsSettings(
targetAggregatesConfig.TARGETS_DEFAULT_CONFIG,
userWithManyPlaces
);
await commonPage.sync(true);
await browser.refresh();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ const updateAggregateTargetsSettings = async (targetsConfig, user, contactSummar
const settings = await utils.getSettings();
settings.tasks.targets.items = targetsConfig;
settings.permissions.can_aggregate_targets = user.roles;
await utils.updateSettings({ tasks: settings.tasks, permissions: settings.permissions, contact_summary: contactSummary }, { ignoreReload: true });
await utils.updateSettings(
{ tasks: settings.tasks, permissions: settings.permissions, contact_summary: contactSummary },
{ ignoreReload: true }
);
await commonPage.closeReloadModal();
await commonPage.goToBase();
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,10 @@ describe('Bikram Sambat date display', () => {
const contactSummaryFile = path.join(__dirname, 'bikram-sambat-contact-template-config.js');

const { contactSummary } = await chtConfUtils.compileNoolsConfig({ contactSummary: contactSummaryFile });
await utils.updateSettings({ contact_summary: contactSummary, forms, registrations, transitions }, { ignoreReload: true });
await utils.updateSettings(
{ contact_summary: contactSummary, forms, registrations, transitions },
{ ignoreReload: true }
);

const formsPath = path.join(__dirname, 'forms');
await chtConfUtils.compileAndUploadAppForms(formsPath);
Expand Down
35 changes: 28 additions & 7 deletions tests/integration/api/controllers/replication.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,10 @@ describe('replication', () => {
});

it('should show contacts to a user only if they are within the configured depth', async () => {
await utils.updateSettings({ replication_depth: [{ role: 'district_admin', depth: 1 }] }, { ignoreReload: true });
await utils.updateSettings(
{ replication_depth: [{ role: 'district_admin', depth: 1 }] },
{ ignoreReload: true }
);
const response = await requestDocs('chw');
assertDocIds(response, ...chwIds, 'depth_clinic');

Expand Down Expand Up @@ -577,7 +580,10 @@ describe('replication', () => {
_id: 'clinic_patient',
type: 'person',
reported_date: 1,
parent: { _id: 'fixture:chwville', parent: { _id: 'fixture:chw-bossville', parent: { _id: parentPlace._id } } }
parent: {
_id: 'fixture:chwville',
parent: { _id: 'fixture:chw-bossville', parent: { _id: parentPlace._id } }
}
};
const healthCenterPatient = {
_id: 'health_center_patient',
Expand Down Expand Up @@ -638,7 +644,10 @@ describe('replication', () => {
}
};

await utils.updateSettings({ replication_depth: [{ role: 'district_admin', depth: 1 }] }, { ignoreReload: true });
await utils.updateSettings(
{ replication_depth: [{ role: 'district_admin', depth: 1 }] },
{ ignoreReload: true }
);
await utils.saveDocs([clinicReport, clinicReport2, healthCenterReport, bobReport]);

assertDocIds(await requestDocs('chw'), ...chwIds, 'clinic_patient', 'clinic_report', 'clinic_report_2');
Expand Down Expand Up @@ -697,7 +706,10 @@ describe('replication', () => {
}
};

await utils.updateSettings({ replication_depth: [{ role: 'district_admin', depth: 1 }] }, { ignoreReload: true });
await utils.updateSettings(
{ replication_depth: [{ role: 'district_admin', depth: 1 }] },
{ ignoreReload: true }
);
await utils.saveDocs([clinicReport, clinicReport2, healthCenterReport, bobReport]);

assertDocIds(await requestDocs('chw'), ...chwIds, 'clinic_patient', 'clinic_report', 'clinic_report_2');
Expand Down Expand Up @@ -770,7 +782,10 @@ describe('replication', () => {
}
};

await utils.updateSettings({ replication_depth: [{ role: 'district_admin', depth: 1, report_depth: 0 }] }, { ignoreReload: true });
await utils.updateSettings(
{ replication_depth: [{ role: 'district_admin', depth: 1, report_depth: 0 }] },
{ ignoreReload: true }
);
await utils.saveDocs([clinicReport, clinicReport2, healthCenterReport, bobReport]);

assertDocIds(await requestDocs('chw'), ...chwIds, 'clinic_patient', 'clinic_report', 'clinic_report_2');
Expand Down Expand Up @@ -1076,7 +1091,10 @@ describe('replication', () => {
await utils.saveDocs(reports);

const seq = await sentinelUtils.getCurrentSeq();
await utils.updateSettings({ purge: { fn: purgeFn.toString(), text_expression: 'every 1 seconds' } }, { ignoreReload: true });
await utils.updateSettings(
{ purge: { fn: purgeFn.toString(), text_expression: 'every 1 seconds' } },
{ ignoreReload: true }
);
await utils.stopSentinel();
await utils.startSentinel();
await sentinelUtils.waitForPurgeCompletion(seq);
Expand All @@ -1099,7 +1117,10 @@ describe('replication', () => {

await utils.saveDocs(reports);
const seq = await sentinelUtils.getCurrentSeq();
await utils.updateSettings({ purge: { fn: purgeFn.toString(), text_expression: 'every 1 seconds' } }, { ignoreReload: true });
await utils.updateSettings(
{ purge: { fn: purgeFn.toString(), text_expression: 'every 1 seconds' } },
{ ignoreReload: true }
);
await utils.stopSentinel();
await utils.startSentinel();
await sentinelUtils.waitForPurgeCompletion(seq);
Expand Down
5 changes: 4 additions & 1 deletion tests/integration/api/controllers/users.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,10 @@ describe('Users API', () => {
};
return utils
.revertSettings(true)
.then(() => utils.updateSettings({ transitions: { generate_patient_id_on_people: true } }, { ignoreReload: true }))
.then(() => utils.updateSettings(
{ transitions: { generate_patient_id_on_people: true } },
{ ignoreReload: true }
))
.then(() => utils.saveDoc(parentPlace))
.then(() => {
const opts = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,10 @@ describe('create_user_for_contacts', () => {
});

it('does not replace user when transition is disabled', async () => {
await utils.updateSettings(getSettings({ transitions: { create_user_for_contacts: false } }), { ignoreReload: 'sentinel' });
await utils.updateSettings(
getSettings({ transitions: { create_user_for_contacts: false } }),
{ ignoreReload: 'sentinel' }
);
await utils.createUsers([ORIGINAL_USER]);
newUsers.push(ORIGINAL_USER.username);
await utils.saveDoc(NEW_PERSON);
Expand Down Expand Up @@ -721,7 +724,10 @@ describe('create_user_for_contacts', () => {
});

it('does not create user when transition is disabled', async () => {
await utils.updateSettings(getSettings({ transitions: { create_user_for_contacts: false } }), { ignoreReload: 'sentinel' });
await utils.updateSettings(
getSettings({ transitions: { create_user_for_contacts: false } }),
{ ignoreReload: 'sentinel' }
);

const originalContact = {
roles: ['chw', 'other-role'],
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ const updateSettings = async (updates, options = {}) => {
await watcher.promise;
}
if (sync) {
await commonPage.sync(true);
await commonElements.sync(true);
}
if (refresh) {
await browser.refresh();
Expand Down

0 comments on commit 231e313

Please sign in to comment.