From a58a216827e77e46d68b51b9922f7ad079720c50 Mon Sep 17 00:00:00 2001 From: Jo Humphrey <31373245+jamdelion@users.noreply.github.com> Date: Mon, 16 Sep 2024 12:39:46 +0100 Subject: [PATCH] Fix linting --- .../src/create-flow/create-flow.spec.ts | 28 +++++----- .../ui-driven/src/helpers/addComponent.ts | 52 +++++++++---------- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/e2e/tests/ui-driven/src/create-flow/create-flow.spec.ts b/e2e/tests/ui-driven/src/create-flow/create-flow.spec.ts index 53763248d3..0db5895bcc 100644 --- a/e2e/tests/ui-driven/src/create-flow/create-flow.spec.ts +++ b/e2e/tests/ui-driven/src/create-flow/create-flow.spec.ts @@ -69,7 +69,7 @@ test.describe("Navigation", () => { let isRepeatedRequestMade = false; page.on( "request", - (req) => (isRepeatedRequestMade = isGetUserRequest(req)) + (req) => (isRepeatedRequestMade = isGetUserRequest(req)), ); Promise.all([ @@ -127,7 +127,7 @@ test.describe("Navigation", () => { "No", ]); await expect( - page.locator("a").filter({ hasText: questionText }) + page.locator("a").filter({ hasText: questionText }), ).toBeVisible(); // Add a notice to the "Yes" path @@ -137,7 +137,7 @@ test.describe("Navigation", () => { await createNotice( page, yesBranch.locator(".hanger > a"), - yesBranchNoticeText + yesBranchNoticeText, ); // Add a notice to the "No" path @@ -146,7 +146,7 @@ test.describe("Navigation", () => { await createNotice( page, noBranch.locator(".hanger > a"), - noBranchNoticeText + noBranchNoticeText, ); const getNextNode = () => page.locator(".hanger > a").last(); @@ -165,14 +165,14 @@ test.describe("Navigation", () => { page, getNextNode(), "What is your address?", - "some data field" + "some data field", ); await createContactInput( page, getNextNode(), "What is your contact info?", - "some data field" + "some data field", ); await createTaskList(page, getNextNode(), "What you should do next", [ @@ -210,7 +210,7 @@ test.describe("Navigation", () => { await expect(nodes.getByText("Next steps")).toBeVisible(); await expect( - nodes.getByText("Check your answers before sending your application") + nodes.getByText("Check your answers before sending your application"), ).toBeVisible(); }); @@ -225,7 +225,7 @@ test.describe("Navigation", () => { }); await page.goto( - `/${context.team.slug}/${serviceProps.slug}/published?analytics=false` + `/${context.team.slug}/${serviceProps.slug}/published?analytics=false`, ); await expect(page.getByText("Not Found")).toBeVisible(); @@ -259,11 +259,11 @@ test.describe("Navigation", () => { }); await page.goto( - `/${context.team.slug}/${serviceProps.slug}/published?analytics=false` + `/${context.team.slug}/${serviceProps.slug}/published?analytics=false`, ); await expect( - page.getByRole("heading", { level: 1, name: "Offline" }) + page.getByRole("heading", { level: 1, name: "Offline" }), ).toBeVisible(); }); @@ -282,7 +282,7 @@ test.describe("Navigation", () => { page.getByLabel("Offline").click(); page.getByRole("button", { name: "Save", disabled: false }).click(); await expect( - page.getByText("Service settings updated successfully") + page.getByText("Service settings updated successfully"), ).toBeVisible(); // Exit back to main Editor page @@ -305,13 +305,13 @@ test.describe("Navigation", () => { }); await page.goto( - `/${context.team.slug}/${serviceProps.slug}/published?analytics=false` + `/${context.team.slug}/${serviceProps.slug}/published?analytics=false`, ); await answerQuestion({ page, title: "Is this a test?", answer: "Yes" }); await clickContinue({ page }); await expect( - page.locator("h1", { hasText: "Yes! this is a test" }) + page.locator("h1", { hasText: "Yes! this is a test" }), ).toBeVisible(); await page.getByTestId("backButton").click(); @@ -319,7 +319,7 @@ test.describe("Navigation", () => { await answerQuestion({ page, title: "Is this a test?", answer: "No" }); await clickContinue({ page }); await expect( - page.locator("h1", { hasText: "Sorry, this is a test" }) + page.locator("h1", { hasText: "Sorry, this is a test" }), ).toBeVisible(); }); }); diff --git a/e2e/tests/ui-driven/src/helpers/addComponent.ts b/e2e/tests/ui-driven/src/helpers/addComponent.ts index 6e206d0519..d91438770a 100644 --- a/e2e/tests/ui-driven/src/helpers/addComponent.ts +++ b/e2e/tests/ui-driven/src/helpers/addComponent.ts @@ -6,7 +6,7 @@ const createBaseComponent = async ( locatingNode: Locator, type: ComponentType, title?: string, - options?: string[] + options?: string[], ) => { await locatingNode.click(); await page.getByRole("dialog").waitFor(); @@ -107,27 +107,27 @@ export const createQuestionWithOptions = async ( page: Page, locatingNode: Locator, questionText: string, - options: string[] + options: string[], ) => { await createBaseComponent( page, locatingNode, ComponentType.Question, questionText, - options + options, ); }; export const createNotice = async ( page: Page, locatingNode: Locator, - noticeText: string + noticeText: string, ) => { await createBaseComponent( page, locatingNode, ComponentType.Notice, - noticeText + noticeText, ); }; @@ -135,27 +135,27 @@ export const createChecklist = async ( page: Page, locatingNode: Locator, checklistTitle: string, - checklistOptions: string[] + checklistOptions: string[], ) => { await createBaseComponent( page, locatingNode, ComponentType.Checklist, checklistTitle, - checklistOptions + checklistOptions, ); }; export const createTextInput = async ( page: Page, locatingNode: Locator, - inputTitle: string + inputTitle: string, ) => { await createBaseComponent( page, locatingNode, ComponentType.TextInput, - inputTitle + inputTitle, ); }; @@ -163,27 +163,27 @@ export const createNumberInput = async ( page: Page, locatingNode: Locator, inputTitle: string, - inputUnits: string + inputUnits: string, ) => { await createBaseComponent( page, locatingNode, ComponentType.NumberInput, inputTitle, - [inputUnits] + [inputUnits], ); }; export const createDateInput = async ( page: Page, locatingNode: Locator, - inputTitle: string + inputTitle: string, ) => { await createBaseComponent( page, locatingNode, ComponentType.DateInput, - inputTitle + inputTitle, ); }; @@ -191,14 +191,14 @@ export const createAddressInput = async ( page: Page, locatingNode: Locator, inputTitle: string, - inputDataField: string + inputDataField: string, ) => { await createBaseComponent( page, locatingNode, ComponentType.AddressInput, inputTitle, - [inputDataField] + [inputDataField], ); }; @@ -206,14 +206,14 @@ export const createContactInput = async ( page: Page, locatingNode: Locator, inputTitle: string, - inputDataField: string + inputDataField: string, ) => { await createBaseComponent( page, locatingNode, ComponentType.ContactInput, inputTitle, - [inputDataField] + [inputDataField], ); }; @@ -221,14 +221,14 @@ export const createTaskList = async ( page: Page, locatingNode: Locator, title: string, - taskListOptions: string[] + taskListOptions: string[], ) => { await createBaseComponent( page, locatingNode, ComponentType.TaskList, title, - taskListOptions + taskListOptions, ); }; @@ -242,12 +242,12 @@ export const createFindProperty = async (page: Page, locatingNode: Locator) => { export const createPlanningConstraints = async ( page: Page, - locatingNode: Locator + locatingNode: Locator, ) => { await createBaseComponent( page, locatingNode, - ComponentType.PlanningConstraints + ComponentType.PlanningConstraints, ); }; @@ -258,35 +258,35 @@ export const createDrawBoundary = async (page: Page, locatingNode: Locator) => { export const createNextSteps = async ( page: Page, locatingNode: Locator, - nextSteps: string[] + nextSteps: string[], ) => { await createBaseComponent( page, locatingNode, ComponentType.NextSteps, undefined, - nextSteps + nextSteps, ); }; export const createFileUpload = async ( page: Page, locatingNode: Locator, - dataField: string + dataField: string, ) => { await createBaseComponent( page, locatingNode, ComponentType.FileUpload, undefined, - [dataField] + [dataField], ); }; async function createComponentOptions( options: string[], buttonText: string, - page: Page + page: Page, ) { let index = 0; for (const option of options) {