Skip to content
Merged
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
22 changes: 22 additions & 0 deletions packages/e2e/src/diff.text-cursor.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import type { Test } from '@lvce-editor/test-with-playwright'

export const name = 'diff.text-cursor'

export const test: Test = async ({ DiffView, expect, FileSystem, Locator, Workspace }) => {
const tmpDir = await FileSystem.getTmpDir()
await FileSystem.writeFile(`${tmpDir}/before.txt`, 'alpha')
await FileSystem.writeFile(`${tmpDir}/after.txt`, 'beta')
await Workspace.setPath(tmpDir)

await DiffView.open(`${tmpDir}/before.txt`, `${tmpDir}/after.txt`)

const beforeRows = Locator('.DiffEditorContentLeft .DiffEditorRows')
const afterRows = Locator('.DiffEditorContentRight .DiffEditorRows')
const beforeLineNumber = Locator('.DiffEditorContentLeft .DiffEditorLineNumber').first()
const sash = Locator('.SashVertical').first()

await expect(beforeRows).toHaveCSS('cursor', 'text')
await expect(afterRows).toHaveCSS('cursor', 'text')
await expect(beforeLineNumber).toHaveCSS('cursor', 'auto')
await expect(sash).toHaveCSS('cursor', 'col-resize')
}
Loading