Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
jamdelion committed Sep 16, 2024
1 parent 24d2bd6 commit a58a216
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 40 deletions.
28 changes: 14 additions & 14 deletions e2e/tests/ui-driven/src/create-flow/create-flow.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ test.describe("Navigation", () => {
let isRepeatedRequestMade = false;
page.on(
"request",
(req) => (isRepeatedRequestMade = isGetUserRequest(req))
(req) => (isRepeatedRequestMade = isGetUserRequest(req)),
);

Promise.all([
Expand Down Expand Up @@ -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
Expand All @@ -137,7 +137,7 @@ test.describe("Navigation", () => {
await createNotice(
page,
yesBranch.locator(".hanger > a"),
yesBranchNoticeText
yesBranchNoticeText,
);

// Add a notice to the "No" path
Expand All @@ -146,7 +146,7 @@ test.describe("Navigation", () => {
await createNotice(
page,
noBranch.locator(".hanger > a"),
noBranchNoticeText
noBranchNoticeText,
);

const getNextNode = () => page.locator(".hanger > a").last();
Expand All @@ -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", [
Expand Down Expand Up @@ -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();
});

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

Expand All @@ -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
Expand All @@ -305,21 +305,21 @@ 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();

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();
});
});
52 changes: 26 additions & 26 deletions e2e/tests/ui-driven/src/helpers/addComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -107,128 +107,128 @@ 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,
);
};

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,
);
};

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,
);
};

export const createAddressInput = async (
page: Page,
locatingNode: Locator,
inputTitle: string,
inputDataField: string
inputDataField: string,
) => {
await createBaseComponent(
page,
locatingNode,
ComponentType.AddressInput,
inputTitle,
[inputDataField]
[inputDataField],
);
};

export const createContactInput = async (
page: Page,
locatingNode: Locator,
inputTitle: string,
inputDataField: string
inputDataField: string,
) => {
await createBaseComponent(
page,
locatingNode,
ComponentType.ContactInput,
inputTitle,
[inputDataField]
[inputDataField],
);
};

export const createTaskList = async (
page: Page,
locatingNode: Locator,
title: string,
taskListOptions: string[]
taskListOptions: string[],
) => {
await createBaseComponent(
page,
locatingNode,
ComponentType.TaskList,
title,
taskListOptions
taskListOptions,
);
};

Expand All @@ -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,
);
};

Expand All @@ -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) {
Expand Down

0 comments on commit a58a216

Please sign in to comment.