diff --git a/packages/e2e/src/diff.ambiguous-duplicated-codeblocks.ts b/packages/e2e/src/diff.ambiguous-duplicated-codeblocks.ts index ec76396..d7bd24a 100644 --- a/packages/e2e/src/diff.ambiguous-duplicated-codeblocks.ts +++ b/packages/e2e/src/diff.ambiguous-duplicated-codeblocks.ts @@ -2,8 +2,6 @@ import type { Test } from '@lvce-editor/test-with-playwright' export const name = 'diff.ambiguous-duplicated-codeblocks' -export const skip = 1 - const expectRowsToHaveText = async (expect: any, rows: any, texts: readonly string[]): Promise => { for (let index = 0; index < texts.length; index += 1) { await expect(rows.nth(index)).toHaveText(texts[index]) @@ -62,14 +60,18 @@ const afterAnchor = true`, const leftRows = Locator('.DiffEditorContentLeft .EditorRow') const rightRows = Locator('.DiffEditorContentRight .EditorRow') + const rightGutterItems = Locator('.DiffEditorContentRight .DiffEditorGutter > div') const rightLineNumbers = Locator('.DiffEditorContentRight .DiffEditorLineNumber') + const rightEmptyLineNumbers = Locator('.DiffEditorContentRight .DiffEditorLineNumberEmpty') const deletedRows = Locator('.DiffEditorContentLeft .EditorRow.Deletion') const insertedRows = Locator('.DiffEditorContentRight .EditorRow.Insertion') const blockLines = block.split('\n') await expect(leftRows).toHaveCount(17) await expect(rightRows).toHaveCount(17) - await expect(rightLineNumbers).toHaveCount(17) + await expect(rightGutterItems).toHaveCount(13) + await expect(rightLineNumbers).toHaveCount(12) + await expect(rightEmptyLineNumbers).toHaveCount(1) await expect(deletedRows).toHaveCount(5) await expect(insertedRows).toHaveCount(0) await expect(deletedRows.nth(0)).toHaveText('if (enabled) {') @@ -87,8 +89,9 @@ const afterAnchor = true`, expectRowsToHaveText(expect, rightRows, ['const beforeAnchor = true', ...blockLines, ...blockLines, '', '', '', '', '', 'const afterAnchor = true']), ]) await expectOneOf([ - (): Promise => expectRowsToHaveText(expect, rightLineNumbers, ['1', '', '', '', '', '', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12']), - (): Promise => expectRowsToHaveText(expect, rightLineNumbers, ['1', '2', '3', '4', '5', '6', '', '', '', '', '', '7', '8', '9', '10', '11', '12']), - (): Promise => expectRowsToHaveText(expect, rightLineNumbers, ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '', '', '', '', '', '12']), + (): Promise => expectRowsToHaveText(expect, rightGutterItems, ['1', '', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12']), + (): Promise => expectRowsToHaveText(expect, rightGutterItems, ['1', '2', '3', '4', '5', '6', '', '7', '8', '9', '10', '11', '12']), + (): Promise => expectRowsToHaveText(expect, rightGutterItems, ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '', '12']), ]) + await expect(rightEmptyLineNumbers.nth(0)).toHaveAttribute('style', 'height: 100px;') }