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,69 +1,65 @@
import type { Page } from "@playwright/test";
import { expect } from "../fixtures";
import type { Page } from '@playwright/test';
import { expect } from '../fixtures';
export class AuthPage {
private readonly page: Page;
constructor(page: Page) {
this.page = page;
}
constructor(private page: Page) {}
async gotoLogin() {
await this.page.goto("/login");
await expect(this.page.getByRole("heading")).toContainText("Sign In");
await this.page.goto('/login');
await expect(this.page.getByRole('heading')).toContainText('Sign In');
}
async gotoRegister() {
await this.page.goto("/register");
await expect(this.page.getByRole("heading")).toContainText("Sign Up");
await this.page.goto('/register');
await expect(this.page.getByRole('heading')).toContainText('Sign Up');
}
async register(email: string, password: string) {
await this.gotoRegister();
await this.page.getByPlaceholder("user@acme.com").click();
await this.page.getByPlaceholder("user@acme.com").fill(email);
await this.page.getByLabel("Password").click();
await this.page.getByLabel("Password").fill(password);
await this.page.getByRole("button", { name: "Sign Up" }).click();
await this.page.getByPlaceholder('user@acme.com').click();
await this.page.getByPlaceholder('user@acme.com').fill(email);
await this.page.getByLabel('Password').click();
await this.page.getByLabel('Password').fill(password);
await this.page.getByRole('button', { name: 'Sign Up' }).click();
}
async login(email: string, password: string) {
await this.gotoLogin();
await this.page.getByPlaceholder("user@acme.com").click();
await this.page.getByPlaceholder("user@acme.com").fill(email);
await this.page.getByLabel("Password").click();
await this.page.getByLabel("Password").fill(password);
await this.page.getByRole("button", { name: "Sign In" }).click();
await this.page.getByPlaceholder('user@acme.com').click();
await this.page.getByPlaceholder('user@acme.com').fill(email);
await this.page.getByLabel('Password').click();
await this.page.getByLabel('Password').fill(password);
await this.page.getByRole('button', { name: 'Sign In' }).click();
}
async logout(email: string, password: string) {
await this.login(email, password);
await this.page.waitForURL("/");
await this.page.waitForURL('/');
await this.openSidebar();
const userNavButton = this.page.getByTestId("user-nav-button");
const userNavButton = this.page.getByTestId('user-nav-button');
await expect(userNavButton).toBeVisible();
await userNavButton.click();
const userNavMenu = this.page.getByTestId("user-nav-menu");
const userNavMenu = this.page.getByTestId('user-nav-menu');
await expect(userNavMenu).toBeVisible();
const authMenuItem = this.page.getByTestId("user-nav-item-auth");
await expect(authMenuItem).toContainText("Sign out");
const authMenuItem = this.page.getByTestId('user-nav-item-auth');
await expect(authMenuItem).toContainText('Sign out');
await authMenuItem.click();
const userEmail = this.page.getByTestId("user-email");
await expect(userEmail).toContainText("Guest");
const userEmail = this.page.getByTestId('user-email');
await expect(userEmail).toContainText('Guest');
}
async expectToastToContain(text: string) {
await expect(this.page.getByTestId("toast")).toContainText(text);
await expect(this.page.getByTestId('toast')).toContainText(text);
}
async openSidebar() {
const sidebarToggleButton = this.page.getByTestId("sidebar-toggle-button");
const sidebarToggleButton = this.page.getByTestId('sidebar-toggle-button');
await sidebarToggleButton.click();
}
}