import { Keys } from '@ephox/agar'; import { describe, it } from '@ephox/bedrock-client'; import { TinyContentActions, TinyHooks, TinySelections } from '@ephox/wrap-mcagar'; import { assert } from 'chai'; import Editor from 'tinymce/core/api/Editor'; import ListsPlugin from 'tinymce/plugins/lists/Plugin'; import TablePlugin from 'tinymce/plugins/table/Plugin'; describe('browser.tinymce.plugins.table.IndentListsInTableTest', () => { const hook = TinyHooks.bddSetupLight({ plugins: 'lists table', toolbar: 'table numlist', indent: false, base_url: '/project/tinymce/js/tinymce' }, [ ListsPlugin, TablePlugin ], true); const assertTableInnerHTML = (editor: Editor, expected: string) => { const table = editor.getBody().firstChild as HTMLTableElement; assert.equal(table.innerHTML, expected, 'Does not have correct html'); }; it('TBA: ul > li in table', () => { const editor = hook.editor(); editor.setContent('
  • a
  • b
'); TinySelections.setCursor(editor, [ 0, 0, 0, 0, 0, 1 ], 1); TinyContentActions.keystroke(editor, Keys.tab()); assertTableInnerHTML(editor, ''); }); it('TBA: ol > li in table', () => { const editor = hook.editor(); editor.setContent('
  1. a
  2. b
'); TinySelections.setCursor(editor, [ 0, 0, 0, 0, 0, 1 ], 1); TinyContentActions.keystroke(editor, Keys.tab()); assertTableInnerHTML(editor, '
  1. a
    1. b
'); }); it('TBA: dl > dt in table', () => { const editor = hook.editor(); editor.setContent('
a
b
'); TinySelections.setCursor(editor, [ 0, 0, 0, 0, 0, 1 ], 1); TinyContentActions.keystroke(editor, Keys.tab()); assertTableInnerHTML(editor, '
a
b
'); }); });