-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(mobile): show page back by url search (#9100)
close AF-1911
- Loading branch information
Showing
8 changed files
with
75 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { test } from '@affine-test/kit/mobile'; | ||
import { expect, type Page } from '@playwright/test'; | ||
|
||
import { expandCollapsibleSection, openTab } from './utils'; | ||
|
||
const locateBack = (page: Page) => page.getByTestId('page-header-back'); | ||
|
||
test('new doc via app tab should not show back', async ({ page }) => { | ||
// directly open new doc, should not show back | ||
await openTab(page, 'New Page'); | ||
await expect(locateBack(page)).not.toBeVisible(); | ||
const docId = await page.evaluate(() => location.pathname.split('/').pop()); | ||
|
||
// back to home, and open the doc, should show back | ||
await openTab(page, 'home'); | ||
await expandCollapsibleSection(page, 'recent'); | ||
const docCard = page.locator( | ||
`[data-testid="doc-card"][data-doc-id="${docId}"]` | ||
); | ||
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(); | ||
// }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters