From 231e3138327c56f1e9711da1e2a97cd6b328a266 Mon Sep 17 00:00:00 2001 From: Maria Lorena Rodriguez Viruel Date: Mon, 19 Aug 2024 16:53:10 -0400 Subject: [PATCH] Fix eslint lengths --- .../contacts/contact-details.wdio-spec.js | 5 ++- .../targets/target-aggregates.wdio-spec.js | 5 ++- .../utils/aggregates-helper-functions.js | 5 ++- .../nepali-dates-and-numbers.wdio-spec.js | 5 ++- .../api/controllers/replication.spec.js | 35 +++++++++++++++---- .../integration/api/controllers/users.spec.js | 5 ++- .../create-user-for-contacts.spec.js | 10 ++++-- tests/utils/index.js | 2 +- 8 files changed, 57 insertions(+), 15 deletions(-) diff --git a/tests/e2e/default/contacts/contact-details.wdio-spec.js b/tests/e2e/default/contacts/contact-details.wdio-spec.js index 546caa2bbb4..7e7f0003363 100644 --- a/tests/e2e/default/contacts/contact-details.wdio-spec.js +++ b/tests/e2e/default/contacts/contact-details.wdio-spec.js @@ -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 } + ); }; diff --git a/tests/e2e/default/targets/target-aggregates.wdio-spec.js b/tests/e2e/default/targets/target-aggregates.wdio-spec.js index 4f16a9f94eb..afdb9b83afa 100644 --- a/tests/e2e/default/targets/target-aggregates.wdio-spec.js +++ b/tests/e2e/default/targets/target-aggregates.wdio-spec.js @@ -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(); diff --git a/tests/e2e/default/targets/utils/aggregates-helper-functions.js b/tests/e2e/default/targets/utils/aggregates-helper-functions.js index e87cd7b66d5..8eee95aea23 100644 --- a/tests/e2e/default/targets/utils/aggregates-helper-functions.js +++ b/tests/e2e/default/targets/utils/aggregates-helper-functions.js @@ -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(); }; diff --git a/tests/e2e/default/translations/nepali-dates-and-numbers.wdio-spec.js b/tests/e2e/default/translations/nepali-dates-and-numbers.wdio-spec.js index 7b40898342b..31add4824ef 100644 --- a/tests/e2e/default/translations/nepali-dates-and-numbers.wdio-spec.js +++ b/tests/e2e/default/translations/nepali-dates-and-numbers.wdio-spec.js @@ -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); diff --git a/tests/integration/api/controllers/replication.spec.js b/tests/integration/api/controllers/replication.spec.js index 1f8845c5064..88602985b09 100644 --- a/tests/integration/api/controllers/replication.spec.js +++ b/tests/integration/api/controllers/replication.spec.js @@ -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'); @@ -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', @@ -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'); @@ -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'); @@ -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'); @@ -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); @@ -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); diff --git a/tests/integration/api/controllers/users.spec.js b/tests/integration/api/controllers/users.spec.js index 0c45db735f4..35fc6f70664 100644 --- a/tests/integration/api/controllers/users.spec.js +++ b/tests/integration/api/controllers/users.spec.js @@ -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 = { diff --git a/tests/integration/sentinel/transitions/create-user-for-contacts.spec.js b/tests/integration/sentinel/transitions/create-user-for-contacts.spec.js index bec1b8a77ca..d534d67137e 100644 --- a/tests/integration/sentinel/transitions/create-user-for-contacts.spec.js +++ b/tests/integration/sentinel/transitions/create-user-for-contacts.spec.js @@ -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); @@ -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'], diff --git a/tests/utils/index.js b/tests/utils/index.js index a359e0a9270..4adda55fa6c 100644 --- a/tests/utils/index.js +++ b/tests/utils/index.js @@ -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();