feat: dynamic model discovery from vercel ai gateway (#1353)
This commit is contained in:
parent
2b0b42d144
commit
b1da86062e
74 changed files with 7426 additions and 2277 deletions
53
tests/e2e/auth.test.ts
Normal file
53
tests/e2e/auth.test.ts
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
|
||||
test.describe("Authentication", () => {
|
||||
test("can register a new account", async ({ page }) => {
|
||||
const timestamp = Date.now();
|
||||
const email = `test-${timestamp}@example.com`;
|
||||
const password = "testpassword123";
|
||||
|
||||
await page.goto("/register");
|
||||
await page.getByPlaceholder("user@acme.com").fill(email);
|
||||
await page.getByLabel("Password").fill(password);
|
||||
await page.getByRole("button", { name: "Sign Up" }).click();
|
||||
|
||||
await expect(page.getByTestId("toast")).toContainText(
|
||||
"Account created successfully"
|
||||
);
|
||||
await expect(page).toHaveURL("/");
|
||||
});
|
||||
|
||||
test("can login with credentials", async ({ page }) => {
|
||||
const timestamp = Date.now();
|
||||
const email = `test-${timestamp}@example.com`;
|
||||
const password = "testpassword123";
|
||||
|
||||
await page.goto("/register");
|
||||
await page.getByPlaceholder("user@acme.com").fill(email);
|
||||
await page.getByLabel("Password").fill(password);
|
||||
await page.getByRole("button", { name: "Sign Up" }).click();
|
||||
await expect(page).toHaveURL("/");
|
||||
|
||||
await page.goto("/login");
|
||||
await page.getByPlaceholder("user@acme.com").fill(email);
|
||||
await page.getByLabel("Password").fill(password);
|
||||
await page.getByRole("button", { name: "Sign In" }).click();
|
||||
|
||||
await expect(page).toHaveURL("/");
|
||||
});
|
||||
|
||||
test("shows error for invalid credentials", async ({ page }) => {
|
||||
await page.goto("/login");
|
||||
await page.getByPlaceholder("user@acme.com").fill("invalid@example.com");
|
||||
await page.getByLabel("Password").fill("wrongpassword");
|
||||
await page.getByRole("button", { name: "Sign In" }).click();
|
||||
|
||||
await expect(page.getByTestId("toast")).toBeVisible();
|
||||
});
|
||||
|
||||
test("can continue as guest", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await expect(page.getByTestId("multimodal-input")).toBeVisible();
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue