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

Commit

Permalink
fix: rinominazione metodi di utils
Browse files Browse the repository at this point in the history
  • Loading branch information
simone-amadio-acn committed Feb 6, 2023
1 parent 1496ffd commit 7c401c4
Show file tree
Hide file tree
Showing 13 changed files with 111 additions and 111 deletions.
4 changes: 2 additions & 2 deletions src/audits/municipality/bookingAppointmentAudit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import lighthouse from "lighthouse";
import { loadPageData } from "../../utils/utils";
import {
getRandomMunicipalityThirdLevelPagesUrl,
getRandomThirdLevelPagesUrl,
getServicePageUrl,
} from "../../utils/municipality/utils";
import { auditDictionary } from "../../storage/auditDictionary";
Expand Down Expand Up @@ -49,7 +49,7 @@ class LoadAudit extends Audit {
];

const randomServices: string[] =
await getRandomMunicipalityThirdLevelPagesUrl(
await getRandomThirdLevelPagesUrl(
url,
await getServicePageUrl(url),
'[data-element="service-link"]'
Expand Down
12 changes: 6 additions & 6 deletions src/audits/municipality/bootstrapItaliaDoubleCheckAudit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import {
loadPageData,
} from "../../utils/utils";
import {
getRandomMunicipalityFirstLevelPagesUrl,
getRandomMunicipalitySecondLevelPagesUrl,
getRandomMunicipalityThirdLevelPagesUrl,
getRandomFirstLevelPagesUrl,
getRandomSecondLevelPagesUrl,
getRandomThirdLevelPagesUrl,
getServicePageUrl,
} from "../../utils/municipality/utils";
import { auditScanVariables } from "../../storage/municipality/auditScanVariables";
Expand Down Expand Up @@ -93,15 +93,15 @@ class LoadAudit extends Audit {

const pagesToBeAnalyzed = [
url,
...(await getRandomMunicipalityFirstLevelPagesUrl(
...(await getRandomFirstLevelPagesUrl(
url,
auditVariables.numberOfFirstLevelPageToBeScanned
)),
...(await getRandomMunicipalitySecondLevelPagesUrl(
...(await getRandomSecondLevelPagesUrl(
url,
auditVariables.numberOfSecondLevelPageToBeScanned
)),
...(await getRandomMunicipalityThirdLevelPagesUrl(
...(await getRandomThirdLevelPagesUrl(
url,
await getServicePageUrl(url),
'[data-element="service-link"]',
Expand Down
4 changes: 2 additions & 2 deletions src/audits/municipality/contactsAssistencyAudit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import lighthouse from "lighthouse";
import { getPageElementDataAttribute, loadPageData } from "../../utils/utils";
import {
getRandomMunicipalityThirdLevelPagesUrl,
getRandomThirdLevelPagesUrl,
getServicePageUrl,
} from "../../utils/municipality/utils";
import { CheerioAPI } from "cheerio";
Expand Down Expand Up @@ -60,7 +60,7 @@ class LoadAudit extends Audit {
];

const randomServices: string[] =
await getRandomMunicipalityThirdLevelPagesUrl(
await getRandomThirdLevelPagesUrl(
url,
await getServicePageUrl(url),
'[data-element="service-link"]'
Expand Down
14 changes: 7 additions & 7 deletions src/audits/municipality/cookieDomainCheckAudit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import { run as cookieAudit } from "../../utils/cookieAuditLogic";
import crawlerTypes from "../../types/crawler-types";
import cookie = crawlerTypes.cookie;
import {
getRandomMunicipalityFirstLevelPagesUrl,
getRandomMunicipalitySecondLevelPagesUrl,
getRandomMunicipalityThirdLevelPagesUrl,
getRandomFirstLevelPagesUrl,
getRandomSecondLevelPagesUrl,
getRandomThirdLevelPagesUrl,
getServicePageUrl,
} from "../../utils/municipality/utils";
import { auditScanVariables } from "../../storage/municipality/auditScanVariables";
Expand Down Expand Up @@ -76,21 +76,21 @@ class LoadAudit extends Audit {

const pagesToBeAnalyzed = [
url,
...(await getRandomMunicipalityFirstLevelPagesUrl(
...(await getRandomFirstLevelPagesUrl(
url,
auditVariables.numberOfFirstLevelPageToBeScanned
)),
...(await getRandomMunicipalitySecondLevelPagesUrl(
...(await getRandomSecondLevelPagesUrl(
url,
auditVariables.numberOfSecondLevelPageToBeScanned
)),
...(await getRandomMunicipalityThirdLevelPagesUrl(
...(await getRandomThirdLevelPagesUrl(
url,
await getServicePageUrl(url),
'[data-element="service-link"]',
auditVariables.numberOfServicesToBeScanned
)),
...(await getRandomMunicipalityThirdLevelPagesUrl(
...(await getRandomThirdLevelPagesUrl(
url,
await getButtonUrl(
await loadPageData(url),
Expand Down
4 changes: 2 additions & 2 deletions src/audits/municipality/fontsCheckAudit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import lighthouse from "lighthouse";
import { allowedFonts } from "../../storage/municipality/allowedFonts";
import {
getRandomMunicipalityThirdLevelPagesUrl,
getRandomThirdLevelPagesUrl,
getServicePageUrl,
} from "../../utils/municipality/utils";
import puppeteer from "puppeteer";
Expand Down Expand Up @@ -53,7 +53,7 @@ class LoadAudit extends Audit {
const url = artifacts.origin;

const randomServices: string[] =
await getRandomMunicipalityThirdLevelPagesUrl(
await getRandomThirdLevelPagesUrl(
url,
await getServicePageUrl(url),
'[data-element="service-link"]'
Expand Down
4 changes: 2 additions & 2 deletions src/audits/municipality/metatagAudit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import lighthouse from "lighthouse";
import { loadPageData } from "../../utils/utils";
import {
getRandomMunicipalityThirdLevelPagesUrl,
getRandomThirdLevelPagesUrl,
getServicePageUrl,
} from "../../utils/municipality/utils";
import { CheerioAPI } from "cheerio";
Expand Down Expand Up @@ -65,7 +65,7 @@ class LoadAudit extends Audit {
];

const randomServices: string[] =
await getRandomMunicipalityThirdLevelPagesUrl(
await getRandomThirdLevelPagesUrl(
url,
await getServicePageUrl(url),
'[data-element="service-link"]'
Expand Down
4 changes: 2 additions & 2 deletions src/audits/municipality/serviziAudit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
toMenuItem,
} from "../../utils/utils";
import {
getRandomMunicipalityThirdLevelPagesUrl,
getRandomThirdLevelPagesUrl,
getServicePageUrl,
} from "../../utils/municipality/utils";
import {
Expand Down Expand Up @@ -89,7 +89,7 @@ class LoadAudit extends Audit {
const mandatoryBodyVoices = contentTypeItemsBody;

const randomServices: string[] =
await getRandomMunicipalityThirdLevelPagesUrl(
await getRandomThirdLevelPagesUrl(
url,
await getServicePageUrl(url),
'[data-element="service-link"]',
Expand Down
12 changes: 6 additions & 6 deletions src/audits/school/bootstrapItaliaDoubleCheckAudit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ const Audit = lighthouse.Audit;

import { checkCSSClassesOnPage } from "../../utils/utils";
import {
getRandomSchoolFirstLevelPagesUrl,
getRandomSchoolSecondLevelPagesUrl,
getRandomSchoolServicesUrl,
getRandomFirstLevelPagesUrl,
getRandomSecondLevelPagesUrl,
getRandomServicesUrl,
} from "../../utils/school/utils";
import { auditScanVariables } from "../../storage/school/auditScanVariables";
import { cssClasses } from "../../storage/school/cssClasses";
Expand Down Expand Up @@ -87,15 +87,15 @@ class LoadAudit extends Audit {

const pagesToBeAnalyzed = [
url,
...(await getRandomSchoolFirstLevelPagesUrl(
...(await getRandomFirstLevelPagesUrl(
url,
auditVariables.numberOfFirstLevelPageToBeScanned
)),
...(await getRandomSchoolSecondLevelPagesUrl(
...(await getRandomSecondLevelPagesUrl(
url,
auditVariables.numberOfSecondLevelPageToBeScanned
)),
...(await getRandomSchoolServicesUrl(
...(await getRandomServicesUrl(
url,
auditVariables.numberOfServicesToBeScanned
)),
Expand Down
16 changes: 8 additions & 8 deletions src/audits/school/cookieDomainCheckAudit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
// @ts-ignore
import lighthouse from "lighthouse";
import {
getRandomSchoolFirstLevelPagesUrl,
getRandomSchoolSecondLevelPagesUrl,
getRandomSchoolServicesUrl,
getRandomSchoolLocationsUrl,
getRandomFirstLevelPagesUrl,
getRandomSecondLevelPagesUrl,
getRandomServicesUrl,
getRandomLocationsUrl,
} from "../../utils/school/utils";
import crawlerTypes from "../../types/crawler-types";
import cookie = crawlerTypes.cookie;
Expand Down Expand Up @@ -73,19 +73,19 @@ class LoadAudit extends Audit {

const pagesToBeAnalyzed = [
url,
...(await getRandomSchoolFirstLevelPagesUrl(
...(await getRandomFirstLevelPagesUrl(
url,
auditVariables.numberOfFirstLevelPageToBeScanned
)),
...(await getRandomSchoolSecondLevelPagesUrl(
...(await getRandomSecondLevelPagesUrl(
url,
auditVariables.numberOfSecondLevelPageToBeScanned
)),
...(await getRandomSchoolServicesUrl(
...(await getRandomServicesUrl(
url,
auditVariables.numberOfServicesToBeScanned
)),
...(await getRandomSchoolLocationsUrl(
...(await getRandomLocationsUrl(
url,
auditVariables.numberOfLocationsToBeScanned
)),
Expand Down
4 changes: 2 additions & 2 deletions src/audits/school/fontsCheckAudit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// @ts-ignore
import lighthouse from "lighthouse";
import { allowedFonts } from "../../storage/school/allowedFonts";
import { getRandomSchoolServicesUrl } from "../../utils/school/utils";
import { getRandomServicesUrl } from "../../utils/school/utils";
import puppeteer from "puppeteer";
import { auditDictionary } from "../../storage/auditDictionary";

Expand Down Expand Up @@ -49,7 +49,7 @@ class LoadAudit extends Audit {
): Promise<LH.Audit.ProductBase> {
const url = artifacts.origin;

const randomService: string[] = await getRandomSchoolServicesUrl(url);
const randomService: string[] = await getRandomServicesUrl(url);

if (randomService.length === 0) {
return {
Expand Down
4 changes: 2 additions & 2 deletions src/audits/school/serviziAudit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
missingMenuItems,
toMenuItem,
} from "../../utils/utils";
import { getRandomSchoolServicesUrl } from "../../utils/school/utils";
import { getRandomServicesUrl } from "../../utils/school/utils";
import {
contentTypeItemsBody,
contentTypeItemsHeaders,
Expand Down Expand Up @@ -96,7 +96,7 @@ class LoadAudit extends Audit {

const mandatoryMetadata = contentTypeItemsMetadata;

const randomServices: string[] = await getRandomSchoolServicesUrl(
const randomServices: string[] = await getRandomServicesUrl(
url,
auditVariables.numberOfServicesToBeScanned
);
Expand Down
12 changes: 6 additions & 6 deletions src/utils/municipality/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
loadPageData,
} from "../utils";

const getRandomMunicipalityFirstLevelPagesUrl = async (
const getRandomFirstLevelPagesUrl = async (
url: string,
numberOfPages = 1
): Promise<string[]> => {
Expand Down Expand Up @@ -38,7 +38,7 @@ const getRandomMunicipalityFirstLevelPagesUrl = async (
return getRandomNString(pagesUrls, numberOfPages);
};

const getRandomMunicipalitySecondLevelPagesUrl = async (
const getRandomSecondLevelPagesUrl = async (
url: string,
numberOfPages = 1
): Promise<string[]> => {
Expand Down Expand Up @@ -80,7 +80,7 @@ const getRandomMunicipalitySecondLevelPagesUrl = async (
return getRandomNString(pagesUrls, numberOfPages);
};

const getRandomMunicipalityThirdLevelPagesUrl = async (
const getRandomThirdLevelPagesUrl = async (
url: string,
pageUrl: string,
linkDataElement: string,
Expand Down Expand Up @@ -156,8 +156,8 @@ const getServicePageUrl = async (url: string) => {
};

export {
getRandomMunicipalityFirstLevelPagesUrl,
getRandomMunicipalitySecondLevelPagesUrl,
getRandomMunicipalityThirdLevelPagesUrl,
getRandomFirstLevelPagesUrl,
getRandomSecondLevelPagesUrl,
getRandomThirdLevelPagesUrl,
getServicePageUrl,
};
Loading

0 comments on commit 7c401c4

Please sign in to comment.