From 5422303b7ff57de1a06e4c930ae34e0e35125a87 Mon Sep 17 00:00:00 2001 From: "simone.amadio" Date: Mon, 23 Jan 2023 17:30:34 +0100 Subject: [PATCH] fix: build url negli url di servizi --- src/config/municipality/auditConfig-online.ts | 11 +---------- src/config/school/auditConfig-online.ts | 9 --------- src/utils/utils.ts | 12 ++++++++++++ 3 files changed, 13 insertions(+), 19 deletions(-) diff --git a/src/config/municipality/auditConfig-online.ts b/src/config/municipality/auditConfig-online.ts index e36a9d9a..d6e30027 100644 --- a/src/config/municipality/auditConfig-online.ts +++ b/src/config/municipality/auditConfig-online.ts @@ -136,21 +136,12 @@ const additionalTestsAudit = [ export default { extends: "lighthouse:default", settings: { - onlyAudits: [ - "municipality-ux-ui-consistency-bootstrap-italia-double-check", - "municipality-legislation-cookie-domain-check", - "municipality-servizi-structure-match-model", - "municipality-second-level-pages", - "municipality-legislation-accessibility-declaration-is-present", - ], - /* onlyCategories: [ "performance", "modelComplianceInformation", "reccomandationsAndAdditionalTests", "additionalTests", - ], - */ + ] }, passes: [ diff --git a/src/config/school/auditConfig-online.ts b/src/config/school/auditConfig-online.ts index 677cb858..f66ec6b0 100644 --- a/src/config/school/auditConfig-online.ts +++ b/src/config/school/auditConfig-online.ts @@ -91,14 +91,6 @@ const customAdditionalAudits = [ export default { extends: "lighthouse:default", settings: { - onlyAudits: [ - "school-ux-ui-consistency-bootstrap-italia-double-check", - "school-legislation-cookie-domain-check", - "school-servizi-structure-match-model", - "school-menu-scuola-second-level-structure-match-model", - "school-legislation-accessibility-declaration-is-present", - ], - /* onlyCategories: [ "modelCompliance", @@ -106,7 +98,6 @@ export default { "additionalTests", "performance" ] - */ }, passes: [ diff --git a/src/utils/utils.ts b/src/utils/utils.ts index 2ce37be6..a998b061 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -177,6 +177,12 @@ const getRandomSchoolServicesUrl = async ( } } + for(let i = 0; i < servicesUrls.length; i++){ + if (!servicesUrls[i].includes(url)) { + servicesUrls[i] = await buildUrl(url, servicesUrls[i]); + } + } + return getRandomNString(servicesUrls, numberOfServices); }; @@ -480,6 +486,12 @@ const getRandomMunicipalityServicesUrl = async ( '[data-element="service-link"]' ); + for(let i = 0; i < servicesUrls.length; i++){ + if (!servicesUrls[i].includes(url)) { + servicesUrls[i] = await buildUrl(url, servicesUrls[i]); + } + } + return getRandomNString(servicesUrls, numberOfServices); };