Skip to content

Commit

Permalink
I really need to learn to run lint fix before committing
Browse files Browse the repository at this point in the history
  • Loading branch information
jamdelion committed Sep 5, 2024
1 parent fa6ce2e commit ceba074
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 42 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,
);

// TODO: find a nicer way to find the next node
Expand All @@ -171,15 +171,15 @@ test.describe("Navigation", () => {
page,
nextNode,
"What is your address?",
"some data field"
"some data field",
);

nextNode = page.locator(".hanger > a").nth(11);
await createContactInput(
page,
nextNode,
"What is your contact info?",
"some data field"
"some data field",
);

nextNode = page.locator(".hanger > a").nth(12);
Expand Down Expand Up @@ -227,7 +227,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 @@ -242,7 +242,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 @@ -276,11 +276,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 @@ -299,7 +299,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 @@ -322,21 +322,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();
});
});
56 changes: 28 additions & 28 deletions e2e/tests/ui-driven/src/helpers/addComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const createBaseComponent = async (
locatingNode: Locator,
type: PlanXEditorComponent,
title?: string,
options?: string[]
options?: string[],
) => {
await locatingNode.click();
await page.getByRole("dialog").waitFor();
Expand Down Expand Up @@ -136,128 +136,128 @@ export const createQuestionWithOptions = async (
page: Page,
locatingNode: Locator,
questionText: string,
options: string[]
options: string[],
) => {
await createBaseComponent(
page,
locatingNode,
PlanXEditorComponent.QUESTION,
questionText,
options
options,
);
};

export const createNotice = async (
page: Page,
locatingNode: Locator,
noticeText: string
noticeText: string,
) => {
await createBaseComponent(
page,
locatingNode,
PlanXEditorComponent.NOTICE,
noticeText
noticeText,
);
};

export const createChecklist = async (
page: Page,
locatingNode: Locator,
checklistTitle: string,
checklistOptions: string[]
checklistOptions: string[],
) => {
createBaseComponent(
page,
locatingNode,
PlanXEditorComponent.CHECKLIST,
checklistTitle,
checklistOptions
checklistOptions,
);
};

export const createTextInput = async (
page: Page,
locatingNode: Locator,
inputTitle: string
inputTitle: string,
) => {
await createBaseComponent(
page,
locatingNode,
PlanXEditorComponent.TEXT,
inputTitle
inputTitle,
);
};

export const createNumberInput = async (
page: Page,
locatingNode: Locator,
inputTitle: string,
inputUnits: string
inputUnits: string,
) => {
await createBaseComponent(
page,
locatingNode,
PlanXEditorComponent.NUMBER,
inputTitle,
[inputUnits]
[inputUnits],
);
};

export const createDateInput = async (
page: Page,
locatingNode: Locator,
inputTitle: string
inputTitle: string,
) => {
await createBaseComponent(
page,
locatingNode,
PlanXEditorComponent.DATE,
inputTitle
inputTitle,
);
};

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

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

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

Expand All @@ -269,61 +269,61 @@ export const createFindProperty = async (page: Page, locatingNode: Locator) => {
await createBaseComponent(
page,
locatingNode,
PlanXEditorComponent.FIND_PROPERTY
PlanXEditorComponent.FIND_PROPERTY,
);
};

export const createPlanningConstraints = async (
page: Page,
locatingNode: Locator
locatingNode: Locator,
) => {
await createBaseComponent(
page,
locatingNode,
PlanXEditorComponent.PLANNING_CONSTRAINTS
PlanXEditorComponent.PLANNING_CONSTRAINTS,
);
};

export const createDrawBoundary = async (page: Page, locatingNode: Locator) => {
await createBaseComponent(
page,
locatingNode,
PlanXEditorComponent.DRAW_BOUNDARY
PlanXEditorComponent.DRAW_BOUNDARY,
);
};

export const createNextSteps = async (
page: Page,
locatingNode: Locator,
nextSteps: string[]
nextSteps: string[],
) => {
await createBaseComponent(
page,
locatingNode,
PlanXEditorComponent.NEXT_STEPS,
undefined,
nextSteps
nextSteps,
);
};

export const createFileUpload = async (
page: Page,
locatingNode: Locator,
dataField: string
dataField: string,
) => {
await createBaseComponent(
page,
locatingNode,
PlanXEditorComponent.FILE_UPLOAD,
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 ceba074

Please sign in to comment.