Big changes no2
This commit is contained in:
@@ -17,37 +17,35 @@ test.describe('Sidebar', () => {
|
||||
});
|
||||
|
||||
test('should display user avatar and email in sidebar', async ({ page }) => {
|
||||
const userMenuBtn = page.locator('.user-menu-container button').first();
|
||||
await expect(userMenuBtn).toBeVisible();
|
||||
// Should show user email
|
||||
await expect(page.locator('.user-menu-container').getByText(TEST_EMAIL)).toBeVisible();
|
||||
const userMenu = page.locator('.user-menu-container');
|
||||
await expect(userMenu).toBeVisible();
|
||||
// Profile link and logout button should be visible
|
||||
await expect(userMenu.locator('button[aria-label="Sign Out"]')).toBeVisible();
|
||||
await expect(userMenu.locator('a')).toBeVisible();
|
||||
});
|
||||
|
||||
test('should show user dropdown on avatar click with correct items', async ({ page }) => {
|
||||
const btn = page.locator('.user-menu-container button[aria-haspopup="true"]');
|
||||
await expect(btn).toBeVisible();
|
||||
await btn.click();
|
||||
await expect(btn).toHaveAttribute('aria-expanded', 'true', { timeout: 3000 });
|
||||
await expect(page.getByText('Account Settings').first()).toBeVisible();
|
||||
await expect(page.getByText('Switch Organization')).toBeVisible();
|
||||
await expect(page.getByText('Log Out')).toBeVisible();
|
||||
test('should show user profile link and logout button in sidebar', async ({ page }) => {
|
||||
const userMenu = page.locator('.user-menu-container');
|
||||
// Profile link navigates to account settings
|
||||
const profileLink = userMenu.locator('a');
|
||||
await expect(profileLink).toBeVisible();
|
||||
// Logout button is visible
|
||||
const logoutBtn = userMenu.locator('button[aria-label="Sign Out"]');
|
||||
await expect(logoutBtn).toBeVisible();
|
||||
});
|
||||
|
||||
test('should close user dropdown on Escape', async ({ page }) => {
|
||||
const btn = page.locator('.user-menu-container button[aria-haspopup="true"]');
|
||||
await btn.click();
|
||||
await expect(btn).toHaveAttribute('aria-expanded', 'true', { timeout: 3000 });
|
||||
await page.keyboard.press('Escape');
|
||||
await expect(btn).toHaveAttribute('aria-expanded', 'false', { timeout: 3000 });
|
||||
test('should show user name in sidebar profile area', async ({ page }) => {
|
||||
const userMenu = page.locator('.user-menu-container');
|
||||
// Profile area shows a link with user info
|
||||
const profileLink = userMenu.locator('a');
|
||||
await expect(profileLink).toBeVisible({ timeout: 5000 });
|
||||
});
|
||||
|
||||
test('should navigate to account settings from dropdown', async ({ page }) => {
|
||||
const btn = page.locator('.user-menu-container button[aria-haspopup="true"]');
|
||||
await btn.click();
|
||||
await expect(btn).toHaveAttribute('aria-expanded', 'true', { timeout: 3000 });
|
||||
await page.getByText('Account Settings').first().click();
|
||||
test('should navigate to account settings via profile link', async ({ page }) => {
|
||||
const profileLink = page.locator('.user-menu-container a').first();
|
||||
await expect(profileLink).toBeVisible();
|
||||
await profileLink.click();
|
||||
await page.waitForURL(new RegExp(`/${TEST_ORG_SLUG}/account`), { timeout: 10000 });
|
||||
await expect(page.getByRole('heading', { name: 'Account Settings' })).toBeVisible();
|
||||
});
|
||||
|
||||
test('sidebar nav items should be visible', async ({ page }) => {
|
||||
|
||||
@@ -833,7 +833,7 @@ test.describe('Calendar - View Switching', () => {
|
||||
test('should show view mode buttons (Month, Week, Day)', async ({ page }) => {
|
||||
await expect(page.locator('button', { hasText: 'Month' })).toBeVisible({ timeout: 5000 });
|
||||
await expect(page.locator('button', { hasText: 'Week' })).toBeVisible({ timeout: 5000 });
|
||||
await expect(page.locator('button', { hasText: 'Day' })).toBeVisible({ timeout: 5000 });
|
||||
await expect(page.getByRole('button', { name: 'Day', exact: true })).toBeVisible({ timeout: 5000 });
|
||||
});
|
||||
|
||||
test('should switch to Week view', async ({ page }) => {
|
||||
|
||||
Reference in New Issue
Block a user