Skip to content
Merged
Show file tree
Hide file tree
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
27 changes: 27 additions & 0 deletions playwright/e2e/history.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

import { expect, mergeTests } from '@playwright/test'
import { test as editorTest } from '../support/fixtures/editor'
import { test as uploadFileTest } from '../support/fixtures/upload-file'

const test = mergeTests(editorTest, uploadFileTest)

test.beforeEach(async ({ open }) => {
await open()
})

test.describe('Undo manager', () => {
test('Can undo first action in empty document', async ({ editor }) => {
await editor.type('a')
await expect(editor.content).toContainText('a')

const undoButton = editor.getMenu('Undo')
await expect(undoButton).not.toBeDisabled()
await undoButton.click()

await expect(editor.content).not.toContainText('a')
})
})
2 changes: 0 additions & 2 deletions src/extensions/TextDirection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ function TextDirectionPlugin({ types }: { types: string[] }) {
)
const changes = getChangedRanges(transform)

tr.setMeta('addToHistory', false)

changes.forEach(({ newRange }) => {
const nodes = findChildrenInRange(newState.doc, newRange, (node) =>
types.includes(node.type.name),
Expand Down
Loading