Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/e2e/puppeteer/__tests__/cursor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import waitUntil from '../helpers/waitUntil'

vi.setConfig({ testTimeout: 20000, hookTimeout: 20000 })

/** Returns the persistent tree node that contains the editable with the given value. */
const getTreeNode = async (value: string) => {
/** Captures the outer tree node before autofocus replaces its editable with a height shim. */
const captureTreeNode = async (value: string) => {
const editable = (await waitForEditable(value)).asElement()
if (!editable) throw new Error(`Editable "${value}" not found.`)

Expand Down Expand Up @@ -97,15 +97,15 @@ it('set the cursor on the cursor grandparent', async () => {
expect(thoughtValue).toBe('a')
})

it('do nothing when clicking on a hidden ancestor', async () => {
it('do nothing when clicking on a hidden ancestor shim', async () => {
const importText = `
- a
- b
- c
- d`
await paste(importText)
await waitForEditable('d')
const ancestorTreeNode = await getTreeNode('a')
const ancestorTreeNode = await captureTreeNode('a')
await clickThought('d')
await ancestorTreeNode.waitForSelector('[data-editable]', { hidden: true })
await click(ancestorTreeNode)
Expand All @@ -114,15 +114,15 @@ it('do nothing when clicking on a hidden ancestor', async () => {
expect(thoughtValue).toBe('d')
})

it('do nothing when clicking on a hidden great uncle', async () => {
it('do nothing when clicking on a hidden great uncle shim', async () => {
const importText = `
- a
- b
- c
- d`
await paste(importText)

const greatUncleTreeNode = await getTreeNode('d')
const greatUncleTreeNode = await captureTreeNode('d')

// click a to expand b and c
await waitForEditable('a')
Expand Down
Loading