-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
104 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
"scripts": { | ||
"build": "turbo run build --filter=!./apps/social --filter=!./packages/e2e", | ||
"dev": "turbo run dev", | ||
"test": "turbo run test --filter=./packages/e2e", | ||
"test": "turbo run test", | ||
"start": "turbo run start --filter=!./apps/social", | ||
"dev:test": "pnpm --filter @umamin/e2e dev:test", | ||
"dev:www": "turbo run dev --filter=!./apps/social", | ||
|
@@ -28,7 +28,7 @@ | |
"@umamin/eslint-config": "workspace:*", | ||
"@umamin/tsconfig": "workspace:*", | ||
"prettier": "^3.2.5", | ||
"turbo": "^2.0.9" | ||
"turbo": "^2.0.11" | ||
}, | ||
"packageManager": "[email protected]", | ||
"engines": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,31 @@ | ||
import { test, expect } from "../playwright/fixtures.js"; | ||
|
||
// Reset storage state for this file to avoid being authenticated | ||
test.use({ storageState: { cookies: [], origins: [] } }); | ||
test.describe.configure({ mode: "parallel" }); | ||
|
||
test.afterEach(async ({ page }) => { | ||
await page.waitForURL("**/login"); | ||
await expect(page).toHaveTitle(/Umamin — Login/); | ||
await expect( | ||
page.getByRole("heading", { name: "Umamin Account" }) | ||
).toBeVisible(); | ||
test("should be authenticated", async ({ page }) => { | ||
await page.goto("/login"); | ||
await page.waitForURL("**/inbox"); | ||
await expect(page).toHaveTitle(/Umamin — Inbox/); | ||
}); | ||
|
||
test("should redirect unauthenticated users from inbox", async ({ page }) => { | ||
await page.goto("/inbox"); | ||
}); | ||
test.describe("Unauthenticated", () => { | ||
test.use({ storageState: { cookies: [], origins: [] } }); | ||
|
||
test.afterEach(async ({ page }) => { | ||
await page.waitForURL("**/login"); | ||
await expect(page).toHaveTitle(/Umamin — Login/); | ||
await expect( | ||
page.getByRole("heading", { name: "Umamin Account" }) | ||
).toBeVisible(); | ||
}); | ||
|
||
test("should redirect unauthenticated users from inbox", async ({ page }) => { | ||
await page.goto("/inbox"); | ||
}); | ||
|
||
test("should redirect unauthenticated users from settings", async ({ | ||
page, | ||
}) => { | ||
await page.goto("/settings"); | ||
test("should redirect unauthenticated users from settings", async ({ | ||
page, | ||
}) => { | ||
await page.goto("/settings"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { nanoid } from "nanoid"; | ||
import { test, expect } from "../playwright/fixtures.js"; | ||
|
||
const content = `this is a test message ${nanoid()}`; | ||
|
||
test.describe("Sender", () => { | ||
test("can send a message", async ({ page }) => { | ||
await page.goto("/to/test_user"); | ||
await expect(page.getByText("test_user")).toBeVisible(); | ||
|
||
await page.getByPlaceholder("Type your message...").fill(content); | ||
await page.getByTestId("send-msg-btn").click(); | ||
await expect(page.getByTestId("msg-content")).toHaveText(content); | ||
}); | ||
}); | ||
|
||
test.describe("Receiver", () => { | ||
test.use({ storageState: { cookies: [], origins: [] } }); | ||
|
||
test("should receive a new message", async ({ page }) => { | ||
await page.goto("/login"); | ||
await expect(page).toHaveTitle(/Umamin — Login/); | ||
await expect( | ||
page.getByRole("heading", { name: "Umamin Account" }) | ||
).toBeVisible(); | ||
|
||
await page.getByLabel("Username").fill("test_user"); | ||
await page.getByLabel("Password").fill("strong_password"); | ||
await page.getByRole("button", { name: "Login" }).click(); | ||
|
||
await page.waitForURL("**/inbox"); | ||
await expect(page.getByTestId("username")).toHaveText("@test_user"); | ||
await expect(page.getByText(content)).toBeVisible(); | ||
}); | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.