Update Next.js version across dependencies

The Next.js version has been updated across multiple dependencies in the pnpm-lock file. This ensures consistency, removes instances of the canary version, and aligns all packages to use the stable 14.2.0 release.
This commit is contained in:
giancarlo
2024-04-12 17:48:19 +08:00
parent b7aa64b06e
commit 477b8f0d52
21 changed files with 2116 additions and 2089 deletions

View File

@@ -0,0 +1,66 @@
import { expect, Page } from '@playwright/test';
import { AuthPageObject } from '../authentication/auth.po';
export class TeamAccountsPageObject {
private readonly page: Page;
public auth: AuthPageObject;
constructor(page: Page) {
this.page = page;
this.auth = new AuthPageObject(page);
}
async setup(params = this.createTeamName()) {
await this.auth.signUpFlow('/home');
await this.createTeam(params);
}
async getTeamFromSelector(teamSlug: string) {
await this.openAccountsSelector();
return this.page.locator(`[data-test="account-selector-team-${teamSlug}"]`);
}
async goToSettings() {
await this.page.locator('a', {
hasText: 'Settings',
}).click();
}
async openAccountsSelector() {
await this.page.click('[data-test="account-selector-trigger"]');
}
async createTeam({ teamName, slug } = this.createTeamName()) {
await this.openAccountsSelector();
await this.page.click('[data-test="create-team-account-trigger"]');
await this.page.fill('[data-test="create-team-form"] input', teamName);
await this.page.click('[data-test="create-team-form"] button:last-child');
await this.page.waitForURL(`http://localhost:3000/home/${slug}`);
}
async updateName(name: string) {
await this.page.fill('[data-test="update-team-account-name-form"] input', name);
await this.page.click('[data-test="update-team-account-name-form"] button');
}
async deleteAccount(teamName: string) {
await this.page.click('[data-test="delete-team-trigger"]');
expect(await this.page.locator('[data-test="delete-team-form-confirm-input"]').isVisible()).toBeTruthy();
await this.page.fill('[data-test="delete-team-form-confirm-input"]', teamName);
await this.page.click('[data-test="delete-team-form-confirm-button"]');
}
createTeamName() {
const random = (Math.random() * 100).toFixed(0);
const teamName = `Team-Name-${random}`;
const slug = `team-name-${random}`;
return { teamName, slug };
}
}

View File

@@ -0,0 +1,44 @@
import { expect, Page, test } from '@playwright/test';
import { TeamAccountsPageObject } from './team-accounts.po';
test.describe('Team Accounts', () => {
let page: Page;
let teamAccounts: TeamAccountsPageObject;
test.beforeAll(async ({ browser }) => {
page = await browser.newPage();
teamAccounts = new TeamAccountsPageObject(page);
await teamAccounts.setup();
});
test('user can update their profile name', async () => {
const {teamName, slug} = teamAccounts.createTeamName();
await teamAccounts.goToSettings();
await teamAccounts.updateName(teamName);
await page.waitForURL(`http://localhost:3000/home/${slug}/settings`);
await expect(await teamAccounts.getTeamFromSelector(slug)).toBeVisible();
});
});
test.describe('Account Deletion', () => {
test('user can delete their team account', async ({ page }) => {
const teamAccounts = new TeamAccountsPageObject(page);
const params = teamAccounts.createTeamName();
await teamAccounts.setup(params);
await teamAccounts.goToSettings();
await teamAccounts.deleteAccount(params.teamName);
await page.waitForURL('http://localhost:3000/home');
expect(page.url()).toEqual('http://localhost:3000/home');
await expect(await teamAccounts.getTeamFromSelector(params.slug)).not.toBeVisible();
});
});