Files
AFFiNE-Mirror/tests/affine-mobile/e2e/detail.spec.ts
CatsJuice a96cd3eb0a feat(mobile): new docs list for mobile (#12329)
close AF-2514

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
  - Enhanced document explorer on mobile with live updates, responsive masonry layout, and improved empty state handling for all documents, collections, and tags.
  - Added customization for card height and masonry item width in document explorer views.
  - Extended layout components to support additional flexbox styling options for improved layout flexibility.

- **Bug Fixes**
  - Improved flexibility in layout components by supporting additional flexbox styling options.

- **Refactor**
  - Replaced older static document list and menu components with a unified, context-driven explorer for a more dynamic and interactive experience.
  - Removed obsolete CSS and component files related to the previous document list and menu implementations.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-23 07:07:09 +00:00

58 lines
2.0 KiB
TypeScript

import { test } from '@affine-test/kit/mobile';
import { expect, type Page } from '@playwright/test';
const openDocInfoModal = async (page: Page) => {
await page.click('[data-testid="detail-page-header-more-button"]');
await expect(page.getByRole('dialog')).toBeVisible();
await page.getByRole('menuitem', { name: 'view info' }).click();
await expect(page.getByTestId('mobile-menu-back-button')).toBeVisible();
};
test.beforeEach(async ({ page }) => {
const docsTab = page.locator('#app-tabs').getByRole('tab', { name: 'all' });
await expect(docsTab).toBeVisible();
await docsTab.click();
await page.getByTestId('doc-list-item').first().click();
await expect(page.locator('.affine-page-viewport')).toBeVisible();
});
test('can open page view more menu', async ({ page }) => {
await page.click('[data-testid="detail-page-header-more-button"]');
await expect(page.getByRole('dialog')).toBeVisible();
});
test('switch to edgeless mode', async ({ page }) => {
await page.click('[data-testid="detail-page-header-more-button"]');
await expect(page.getByRole('dialog')).toBeVisible();
await page
.getByRole('menuitem', { name: 'Default to Edgeless mode' })
.click();
await expect(page.locator('.affine-edgeless-viewport')).toBeVisible();
});
test('can show doc info', async ({ page }) => {
await openDocInfoModal(page);
await expect(page.getByRole('dialog')).toContainText('Created');
await expect(page.getByRole('dialog')).toContainText('Updated');
});
test('can add text property', async ({ page }) => {
await openDocInfoModal(page);
await expect(
page.getByRole('button', { name: 'Add property' })
).toBeVisible();
await page.getByRole('button', { name: 'Add property' }).click();
await page.getByRole('menuitem', { name: 'Text' }).click();
await expect(
page.getByTestId('mobile-menu-back-button').last()
).toBeVisible();
await page.getByTestId('mobile-menu-back-button').last().click();
await expect(page.getByTestId('mobile-menu-back-button')).toBeVisible();
});