Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Commit

Permalink
fix: build url negli url di servizi
Browse files Browse the repository at this point in the history
  • Loading branch information
simone-amadio-acn committed Jan 23, 2023
1 parent 8935bad commit 5422303
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 19 deletions.
11 changes: 1 addition & 10 deletions src/config/municipality/auditConfig-online.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down
9 changes: 0 additions & 9 deletions src/config/school/auditConfig-online.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,22 +91,13 @@ 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",
"recommendations",
"additionalTests",
"performance"
]
*/
},

passes: [
Expand Down
12 changes: 12 additions & 0 deletions src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};

Expand Down Expand Up @@ -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);
};

Expand Down

0 comments on commit 5422303

Please sign in to comment.