Revert "Upgrade linter and formatter to Ultracite" (#1226)

This commit is contained in:
josh 2025-09-21 12:03:29 +01:00 committed by GitHub
parent 0e320b391d
commit 1aff7d9868
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
177 changed files with 8334 additions and 6943 deletions

View file

@ -1,15 +1,15 @@
import fs from "node:fs";
import path from "node:path";
import fs from 'node:fs';
import path from 'node:path';
import {
type APIRequestContext,
type Browser,
type BrowserContext,
expect,
type Page,
} from "@playwright/test";
import { generateId } from "ai";
import { getUnixTime } from "date-fns";
import { ChatPage } from "./pages/chat";
} from '@playwright/test';
import { generateId } from 'ai';
import { ChatPage } from './pages/chat';
import { getUnixTime } from 'date-fns';
export type UserContext = {
context: BrowserContext;
@ -20,11 +20,13 @@ export type UserContext = {
export async function createAuthenticatedContext({
browser,
name,
chatModel = 'chat-model',
}: {
browser: Browser;
name: string;
chatModel?: 'chat-model' | 'chat-model-reasoning';
}): Promise<UserContext> {
const directory = path.join(__dirname, "../playwright/.sessions");
const directory = path.join(__dirname, '../playwright/.sessions');
if (!fs.existsSync(directory)) {
fs.mkdirSync(directory, { recursive: true });
@ -38,21 +40,21 @@ export async function createAuthenticatedContext({
const email = `test-${name}@playwright.com`;
const password = generateId();
await page.goto("http://localhost:3000/register");
await page.getByPlaceholder("user@acme.com").click();
await page.getByPlaceholder("user@acme.com").fill(email);
await page.getByLabel("Password").click();
await page.getByLabel("Password").fill(password);
await page.getByRole("button", { name: "Sign Up" }).click();
await page.goto('http://localhost:3000/register');
await page.getByPlaceholder('user@acme.com').click();
await page.getByPlaceholder('user@acme.com').fill(email);
await page.getByLabel('Password').click();
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.getByTestId('toast')).toContainText(
'Account created successfully!',
);
const chatPage = new ChatPage(page);
await chatPage.createNewChat();
await chatPage.chooseModelFromSelector("chat-model-reasoning");
await expect(chatPage.getSelectedModel()).resolves.toEqual("Reasoning model");
await chatPage.chooseModelFromSelector('chat-model-reasoning');
await expect(chatPage.getSelectedModel()).resolves.toEqual('Reasoning model');
await page.waitForTimeout(1000);
await context.storageState({ path: storageFile });