Revert "Unify workspace dropdowns; Update layouts (#458)"

This reverts commit 4bc8448a1d.
This commit is contained in:
gbuomprisco
2026-03-11 14:47:47 +08:00
parent 4bc8448a1d
commit 4912e402a3
530 changed files with 11182 additions and 14382 deletions

View File

@@ -38,8 +38,6 @@ test.describe('Account Settings', () => {
await Promise.all([request, response]);
await page.locator('[data-test="workspace-dropdown-trigger"]').click();
await expect(account.getProfileName()).toHaveText(name);
});

View File

@@ -34,17 +34,17 @@ test.describe('Admin', () => {
await page.goto('/admin');
// Check all stat cards are present
await expect(page.getByText('Users', { exact: true })).toBeVisible();
await expect(page.getByRole('heading', { name: 'Users' })).toBeVisible();
await expect(
page.getByText('Team Accounts', { exact: true }),
page.getByRole('heading', { name: 'Team Accounts' }),
).toBeVisible();
await expect(
page.getByText('Paying Customers', { exact: true }),
page.getByRole('heading', { name: 'Paying Customers' }),
).toBeVisible();
await expect(page.getByText('Trials', { exact: true })).toBeVisible();
await expect(page.getByRole('heading', { name: 'Trials' })).toBeVisible();
// Verify stat values are numbers
const stats = await page.$$('.text-3xl.font-bold');

View File

@@ -31,17 +31,8 @@ export class AuthPageObject {
}
async signOut() {
const trigger = this.page.locator(
'[data-test="workspace-dropdown-trigger"], [data-test="account-dropdown-trigger"]',
);
await trigger.click();
const signOutButton = this.page.locator(
'[data-test="workspace-sign-out"], [data-test="account-dropdown-sign-out"]',
);
await signOutButton.click();
await this.page.click('[data-test="account-dropdown-trigger"]');
await this.page.click('[data-test="account-dropdown-sign-out"]');
}
async signIn(params: { email: string; password: string }) {

View File

@@ -4,7 +4,7 @@ import { expect, test } from '@playwright/test';
test.describe('Healthcheck endpoint', () => {
test('returns healthy status', async ({ request }) => {
const response = await request.get('/api/healthcheck');
const response = await request.get('/healthcheck');
expect(response.status()).toBe(200);

View File

@@ -46,7 +46,7 @@ export class InvitationsPageObject {
`[data-test="invite-member-form-item"]:nth-child(${nth}) [data-test="role-selector-trigger"]`,
);
await this.page.getByRole('option', { name: invite.role }).click();
await this.page.click(`[data-test="role-option-${invite.role}"]`);
if (index < invites.length - 1) {
await form.locator('[data-test="add-new-invite-button"]').click();

View File

@@ -36,13 +36,13 @@ export class TeamAccountsPageObject {
}
getTeamFromSelector(teamName: string) {
return this.page.locator('[data-test="workspace-team-item"]', {
return this.page.locator(`[data-test="account-selector-team"]`, {
hasText: teamName,
});
}
getTeams() {
return this.page.locator('[data-test="workspace-team-item"]');
return this.page.locator('[data-test="account-selector-team"]');
}
goToSettings() {
@@ -83,11 +83,10 @@ export class TeamAccountsPageObject {
openAccountsSelector() {
return expect(async () => {
await this.page.click('[data-test="workspace-dropdown-trigger"]');
await this.page.click('[data-test="workspace-switch-submenu"]');
await this.page.click('[data-test="account-selector-trigger"]');
return expect(
this.page.locator('[data-test="workspace-switch-content"]'),
this.page.locator('[data-test="account-selector-content"]'),
).toBeVisible();
}).toPass();
}
@@ -116,7 +115,7 @@ export class TeamAccountsPageObject {
async createTeam({ teamName, slug } = this.createTeamName()) {
await this.openAccountsSelector();
await this.page.click('[data-test="create-team-trigger"]');
await this.page.click('[data-test="create-team-account-trigger"]');
await this.page.fill(
'[data-test="create-team-form"] [data-test="team-name-input"]',
@@ -141,15 +140,14 @@ export class TeamAccountsPageObject {
await this.openAccountsSelector();
await expect(this.getTeamFromSelector(teamName)).toBeVisible();
// Close the selector (Escape closes submenu, then parent dropdown)
await this.page.keyboard.press('Escape');
// Close the selector
await this.page.keyboard.press('Escape');
}
async createTeamWithNonLatinName(teamName: string, slug: string) {
await this.openAccountsSelector();
await this.page.click('[data-test="create-team-trigger"]');
await this.page.click('[data-test="create-team-account-trigger"]');
await this.page.fill(
'[data-test="create-team-form"] [data-test="team-name-input"]',
@@ -179,8 +177,7 @@ export class TeamAccountsPageObject {
await this.openAccountsSelector();
await expect(this.getTeamFromSelector(teamName)).toBeVisible();
// Close the selector (Escape closes submenu, then parent dropdown)
await this.page.keyboard.press('Escape');
// Close the selector
await this.page.keyboard.press('Escape');
}
@@ -210,10 +207,11 @@ export class TeamAccountsPageObject {
}
async deleteAccount(email: string) {
await this.page.click('[data-test="delete-team-trigger"]');
await this.otp.completeOtpVerification(email);
await expect(async () => {
await this.page.click('[data-test="delete-team-trigger"]');
await this.otp.completeOtpVerification(email);
const click = this.page.click(
'[data-test="delete-team-form-confirm-button"]',
);

View File

@@ -88,7 +88,7 @@ test.describe('Team Accounts', () => {
await teamAccounts.createTeam();
await teamAccounts.openAccountsSelector();
await page.click('[data-test="create-team-trigger"]');
await page.click('[data-test="create-team-account-trigger"]');
await teamAccounts.tryCreateTeam('billing');
@@ -202,7 +202,7 @@ test.describe('Team Accounts', () => {
// Use non-Latin name to trigger the slug field visibility
await teamAccounts.openAccountsSelector();
await page.click('[data-test="create-team-trigger"]');
await page.click('[data-test="create-team-account-trigger"]');
await page.fill(
'[data-test="create-team-form"] [data-test="team-name-input"]',