Skip to content

Commit 236bc42

Browse files
authoredFeb 9, 2025
feature: enable completion scroll e2e test (#552)
1 parent 0199570 commit 236bc42

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed
 

‎packages/e2e/src/editor.completion-scroll.ts

+9-8
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ import type { Test } from '@lvce-editor/test-with-playwright'
22

33
export const name = 'viewlet.completion-scroll'
44

5-
export const skip = 1
6-
7-
export const test: Test = async ({ Extension, FileSystem, Workspace, Main, Editor, Locator, expect }) => {
5+
export const test: Test = async ({ Extension, FileSystem, Workspace, Main, Editor, Locator, expect, Command }) => {
86
// arrange
97
const extensionUri = import.meta.resolve('../fixtures/editor.completion-scroll')
108
await Extension.addWebExtension(extensionUri)
@@ -18,9 +16,12 @@ export const test: Test = async ({ Extension, FileSystem, Workspace, Main, Edito
1816
await Editor.openCompletion()
1917

2018
// assert
21-
const completions = Locator('.EditorCompletion')
22-
await expect(completions).toBeVisible()
23-
await expect(completions).toHaveText('No Results')
24-
await expect(completions).toHaveCSS('top', '75px')
25-
await expect(completions).toHaveCSS('left', '0')
19+
const firstItem = Locator('.EditorCompletionItem').nth(0)
20+
await expect(firstItem).toHaveText('test 0')
21+
22+
// act
23+
await Command.execute('EditorCompletion.handleWheel', 0, 20)
24+
25+
// assert
26+
await expect(firstItem).toHaveText('test 1')
2627
}

0 commit comments

Comments
 (0)