|
|
@@ -130,6 +130,11 @@ describe.skipIf(MODE === 'record')('web e2e: file and session references through
|
|
|
await writeFile(join(scaffold.workspaceCwd, 'workspace', 'reference.txt'), 'reference fixture\n')
|
|
|
await mkdir(join(scaffold.workspaceCwd, 'workspace', 'folderx'), { recursive: true })
|
|
|
await writeFile(join(scaffold.workspaceCwd, 'workspace', 'folderx', 'child.txt'), 'child fixture\n')
|
|
|
+ // Two levels down: the breadcrumb needs a step above the current one to
|
|
|
+ // return to, and a bare '@' lists only the top level, so the deeper tree
|
|
|
+ // stays out of the menu golden.
|
|
|
+ await mkdir(join(scaffold.workspaceCwd, 'workspace', 'folderx', 'nested'), { recursive: true })
|
|
|
+ await writeFile(join(scaffold.workspaceCwd, 'workspace', 'folderx', 'nested', 'leaf.txt'), 'leaf fixture\n')
|
|
|
await page.goto(scaffold.authenticatedUrl, { waitUntil: 'load' })
|
|
|
await page.waitForSelector('[class*="frame"]', { timeout: 30_000 })
|
|
|
await connectFreshWorkspace(page, scaffold.workspaceCwd)
|
|
|
@@ -280,13 +285,20 @@ describe.skipIf(MODE === 'record')('web e2e: file and session references through
|
|
|
await expect.poll(() => input.textContent()).toBe('@folderx/')
|
|
|
await menu.getByRole('option', { name: /child\.txt/ }).waitFor()
|
|
|
|
|
|
- // The row chevron drills the same way by pointer.
|
|
|
+ // The row chevron drills the same way by pointer, header included: a
|
|
|
+ // pointer descent reaches the same listing a Tab descent does.
|
|
|
await writeComposerDraft(page, input, '@folderx')
|
|
|
const row = menu.getByRole('option', { name: /^folderx\// })
|
|
|
await row.waitFor()
|
|
|
await row.getByRole('button', { name: 'Browse folder' }).click()
|
|
|
await expect.poll(() => input.textContent()).toBe('@folderx/')
|
|
|
await menu.getByRole('option', { name: /child\.txt/ }).waitFor()
|
|
|
+ await expect.poll(() => page.getByRole('navigation', { name: 'Folder navigation' })
|
|
|
+ .getByRole('button').allTextContents()).toEqual(['Workspace', 'folderx'])
|
|
|
+ // The listing knows it was drilled into, so its rows drop the location the
|
|
|
+ // header already carries.
|
|
|
+ await expect.poll(() => menu.getByRole('option', { name: /child\.txt/ }).textContent())
|
|
|
+ .toBe('child.txt')
|
|
|
await page.keyboard.press('Escape')
|
|
|
|
|
|
expect(tripwire.pageErrors).toEqual([])
|
|
|
@@ -318,6 +330,20 @@ describe.skipIf(MODE === 'record')('web e2e: file and session references through
|
|
|
await expect.poll(() => menu.getByRole('option', { name: /child\.txt/ }).textContent())
|
|
|
.toBe('child.txt')
|
|
|
|
|
|
+ // A crumb above the current step re-lists that directory and keeps the
|
|
|
+ // header, which now names the step it returned to.
|
|
|
+ await writeComposerDraft(page, input, '@folderx/nested')
|
|
|
+ const nested = menu.getByRole('option', { name: /^nested\// })
|
|
|
+ await nested.waitFor()
|
|
|
+ await nested.getByRole('button', { name: 'Browse folder' }).click()
|
|
|
+ await expect.poll(() => input.textContent()).toBe('@folderx/nested/')
|
|
|
+ await expect.poll(() => crumbs.getByRole('button').allTextContents())
|
|
|
+ .toEqual(['Workspace', 'folderx', 'nested'])
|
|
|
+ await crumbs.getByRole('button', { name: 'folderx' }).click()
|
|
|
+ await expect.poll(() => input.textContent()).toBe('@folderx/')
|
|
|
+ await expect.poll(() => crumbs.getByRole('button').allTextContents())
|
|
|
+ .toEqual(['Workspace', 'folderx'])
|
|
|
+
|
|
|
// Clicking the root crumb rewrites the token back to a bare trigger.
|
|
|
await crumbs.getByRole('button', { name: 'Workspace' }).click()
|
|
|
await expect.poll(() => input.textContent()).toBe('@')
|