Files
AFFiNE-Mirror/tests/affine-mobile/e2e/back-button-visibility.spec.ts
T
DarkSky 1d36e2e4b2 feat(core): improve mobile perf (#15317)
#### PR Dependency Tree


* **PR #15317** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

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

* **New Features**
* Virtualized mobile navigation with shell navigation and interactive
swipe menus; coordinated mobile back handling with interactive
phases/state restoration.
* Added shared auth request proxy and message-port based token handling
across mobile and worker flows.
* **Bug Fixes**
  * Hydrated remote worker error stacks for calls and observable errors.
* Improved SQLite FTS/indexer and nbstore optional text handling;
refined docs-search ref parsing and notification loading/retry.
* **Refactor / UX**
* Modal focus-preservation and pointer behavior updates; improved mobile
menu controls and back gesture plugins.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-07-23 00:23:21 +08:00

35 lines
1.2 KiB
TypeScript

import { test } from '@affine-test/kit/mobile';
import { expect, type Page } from '@playwright/test';
import { expandCollapsibleSection, openTab, pageBack } from './utils';
const locateBack = (page: Page) => page.getByTestId('page-header-back');
test('new doc returns to its source without creating a New destination', async ({
page,
}) => {
await openTab(page, 'New Page');
await expect(locateBack(page)).toBeVisible();
await pageBack(page);
await expect(page).toHaveURL(/\/home$/);
await expandCollapsibleSection(page, 'recent');
const docCard = page.getByTestId('doc-card').first();
await expect(docCard).toBeVisible();
await docCard.click();
await expect(locateBack(page)).toBeVisible();
});
// TODO(@CatsJuice): mobile @ menu is not ready
// test('jump to linked doc should show back', async ({ page }) => {
// await openTab(page, 'New Page');
// await expect(locateBack(page)).not.toBeVisible();
// const docId = await page.evaluate(() => location.pathname.split('/').pop());
// await page.keyboard.type('Test Doc');
// await page.keyboard.press('Enter');
// await page.waitForTimeout(100);
// await createLinkedPage(page, 'Test Linked Doc');
// await expect(locateBack(page)).toBeVisible();
// });