import { describe, it } from '@ephox/bedrock-client'; import { Cell } from '@ephox/katamari'; import { TinyAssertions, TinyHooks, TinySelections } from '@ephox/wrap-mcagar'; import Editor from 'tinymce/core/api/Editor'; import * as DeleteCommands from 'tinymce/core/delete/DeleteCommands'; describe('browser.tinymce.core.delete.DeleteCommandsTest', () => { const caret = Cell(null); const hook = TinyHooks.bddSetupLight({ base_url: '/project/tinymce/js/tinymce', indent: false }, [], true); it('Delete should merge blocks', () => { const editor = hook.editor(); editor.setContent('

a

b

'); TinySelections.setCursor(editor, [ 1, 0, 0 ], 0); DeleteCommands.deleteCommand(editor, caret); TinyAssertions.assertContent(editor, '

ab

'); TinyAssertions.assertSelection(editor, [ 0, 0 ], 1, [ 0, 0 ], 1); }); it('ForwardDelete should merge blocks', () => { const editor = hook.editor(); editor.setContent('

a

b

'); TinySelections.setCursor(editor, [ 0, 0, 0 ], 1); DeleteCommands.forwardDeleteCommand(editor, caret); TinyAssertions.assertContent(editor, '

ab

'); TinyAssertions.assertSelection(editor, [ 0, 0, 0 ], 1, [ 0, 0, 0 ], 1); }); });