Files
AFFiNE-Mirror/tests/affine-mobile/e2e/home.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

53 lines
1.6 KiB
TypeScript

import { test } from '@affine-test/kit/mobile';
import { expect } from '@playwright/test';
import { expandCollapsibleSection } from './utils';
test('after loaded, will land on the home page', async ({ page }) => {
await expect(page).toHaveURL(/.*\/home/);
});
test('app tabs is visible', async ({ page }) => {
const tabs = page.locator('#app-tabs');
await expect(tabs).toBeVisible();
await expect(tabs.getByRole('tab', { name: 'home' })).toBeVisible();
await expect(tabs.getByRole('tab', { name: 'all' })).toBeVisible();
await expect(tabs.getByRole('tab', { name: 'journal' })).toBeVisible();
await expect(tabs.getByRole('tab', { name: 'new' })).toBeVisible();
});
test('recent docs', async ({ page }) => {
const recentSection = await expandCollapsibleSection(page, 'recent');
const docs = recentSection.getByTestId('doc-card');
const firstDoc = docs.first();
await expect(firstDoc).toBeVisible();
const title = await firstDoc
.getByTestId('doc-card-header')
.getByRole('heading')
.textContent();
// when click favorite icon, will show in the favorites section
await docs.getByRole('button', { name: 'favorite' }).first().click();
const favList = await expandCollapsibleSection(page, 'favorites');
await expect(favList).toBeVisible();
if (title) {
await expect(favList).toContainText(title);
}
});
test('all tab', async ({ page }) => {
const docsTab = page.locator('#app-tabs').getByRole('tab', { name: 'all' });
await expect(docsTab).toBeVisible();
await docsTab.click();
const todayDocs = page.getByTestId('doc-list-item');
expect(await todayDocs.count()).toBeGreaterThan(0);
});