Skip to content

Commit

Permalink
format: fixed formatting for Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
1p22geo committed Dec 24, 2023
1 parent d4bc4e8 commit 1a5f03e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions e2e/login.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ test("logs in", async ({ page, userAgent }) => {
await page.goto("./");
await expect(page).toHaveTitle(/WordBook - Internet redefined/);
await expect(await page.getByText(/WordBook - the Internet redefined/i)).toBeVisible();
await switchBar(page)
await switchBar(page);
const loc = page.getByText(/Log in/i).filter({ hasNotText: /account/ });
await expect(loc).toBeVisible();
await loc.click();
Expand All @@ -56,7 +56,7 @@ test("logs in", async ({ page, userAgent }) => {
await (await page.$("#password"))?.fill("123");
await (await page.getByText(/submit/i)).click();
await expect(page.locator(".w-md-editor")).toBeVisible();
await switchBar(page)
await switchBar(page);
await expect(page.locator("a").filter({ hasText: "WordBook" })).toBeVisible();
await expect(page.locator("#menu svg.w-full")).toBeVisible();
});
6 changes: 3 additions & 3 deletions e2e/post.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ test("register and login", async ({ userAgent }) => {
await page.goto("./");
await expect(page).toHaveTitle(/WordBook - Internet redefined/);
await expect(await page.getByText(/WordBook - the Internet redefined/i)).toBeVisible();
await switchBar(page)
await switchBar(page);
const loc = page.getByText(/Log in/i).filter({ hasNotText: /account/ });
await expect(loc).toBeVisible();
await loc.click();
Expand All @@ -47,7 +47,7 @@ test("register and login", async ({ userAgent }) => {
await (await page.$("#password"))?.fill("123");
await (await page.getByText(/submit/i)).click();
await expect(page.locator(".w-md-editor")).toBeVisible();
await switchBar(page)
await switchBar(page);
await expect(await page.locator("a").filter({ hasText: "WordBook" })).toBeVisible();
await expect(await page.locator("#menu svg.w-full")).toBeVisible();
});
Expand All @@ -56,7 +56,7 @@ test("submit a post", async ({ userAgent }) => {
const id = sha256(userAgent as string);
const date = Date.now();
await expect(page.locator("#menu svg.w-full")).toBeVisible();
await switchBar(page)
await switchBar(page);
await expect(page.locator(".w-md-editor")).toBeVisible();
await page.locator("textarea").fill("First post by " + "test3@email_" + id + ".com in " + date);
await page.getByText(/submit/i).scrollIntoViewIfNeeded();
Expand Down
10 changes: 5 additions & 5 deletions lib/e2e/switchBar/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Page } from "@playwright/test";

export async function switchBar(page:Page){
const sw = page.locator('#switch')
if(!await sw.isVisible()) return
await sw.click()
}
export async function switchBar(page: Page) {
const sw = page.locator("#switch");
if (!(await sw.isVisible())) return;
await sw.click();
}

0 comments on commit 1a5f03e

Please sign in to comment.