import { describe, it } from '@ephox/bedrock-client'; import { TinyAssertions, TinyHooks, TinySelections, TinyUiActions } from '@ephox/wrap-mcagar'; import Editor from 'tinymce/core/api/Editor'; import Plugin from 'tinymce/plugins/lists/Plugin'; describe('browser.tinymce.plugins.lists.ChangeListStyleTest', () => { const hook = TinyHooks.bddSetupLight({ indent: false, plugins: 'lists', toolbar: 'numlist bullist', base_url: '/project/tinymce/js/tinymce' }, [ Plugin ]); it('TBA: ul to ol, cursor only in parent', () => { const editor = hook.editor(); editor.setContent(''); TinySelections.setCursor(editor, [ 0, 0, 0 ], 0); TinyUiActions.clickOnToolbar(editor, 'button[aria-label="Numbered list"]'); TinyAssertions.assertContent(editor, '
  1. a
'); TinyAssertions.assertSelection(editor, [ 0, 0, 0 ], 0, [ 0, 0, 0 ], 0); }); it('TBA: ul to ol, selection from parent to sublist', () => { const editor = hook.editor(); editor.setContent(''); TinySelections.setSelection(editor, [ 0, 0, 0 ], 0, [ 0, 1, 0, 0 ], 1); TinyUiActions.clickOnToolbar(editor, 'button[aria-label="Numbered list"]'); TinyAssertions.assertContent(editor, '
  1. a
    1. b
'); TinyAssertions.assertSelection(editor, [ 0, 0, 0 ], 0, [ 0, 1, 0, 0 ], 1); }); it('TBA: ol to ul, cursor only in parent', () => { const editor = hook.editor(); editor.setContent('
  1. a
    1. b
'); TinySelections.setCursor(editor, [ 0, 0, 0 ], 0); TinyUiActions.clickOnToolbar(editor, 'button[aria-label="Bullet list"]'); TinyAssertions.assertContent(editor, ''); TinyAssertions.assertSelection(editor, [ 0, 0, 0 ], 0, [ 0, 0, 0 ], 0); }); it('TBA: ol to ul, selection from parent to sublist', () => { const editor = hook.editor(); editor.setContent('
  1. a
'); TinySelections.setSelection(editor, [ 0, 0, 0 ], 0, [ 0, 1, 0, 0 ], 1); TinyUiActions.clickOnToolbar(editor, 'button[aria-label="Bullet list"]'); TinyAssertions.assertContent(editor, ''); TinyAssertions.assertSelection(editor, [ 0, 0, 0 ], 0, [ 0, 1, 0, 0 ], 1); }); it('TBA: alpha to ol, cursor only in parent', () => { const editor = hook.editor(); editor.setContent(''); TinySelections.setCursor(editor, [ 0, 0, 0 ], 0); TinyUiActions.clickOnToolbar(editor, 'button[aria-label="Numbered list"]'); TinyAssertions.assertContent(editor, '
  1. a
    1. b
'); TinyAssertions.assertSelection(editor, [ 0, 0, 0 ], 0, [ 0, 0, 0 ], 0); }); it('TBA: alpha to ol, selection from parent to sublist', () => { const editor = hook.editor(); editor.setContent(''); TinySelections.setSelection(editor, [ 0, 0, 0 ], 0, [ 0, 1, 0, 0 ], 1); TinyUiActions.clickOnToolbar(editor, 'button[aria-label="Numbered list"]'); TinyAssertions.assertContent(editor, '
  1. a
    1. b
'); TinyAssertions.assertSelection(editor, [ 0, 0, 0 ], 0, [ 0, 1, 0, 0 ], 1); }); it('TBA: alpha to ul, cursor only in parent', () => { const editor = hook.editor(); editor.setContent('
  1. a
    1. b
'); TinySelections.setCursor(editor, [ 0, 0, 0 ], 0); TinyUiActions.clickOnToolbar(editor, 'button[aria-label="Bullet list"]'); TinyAssertions.assertContent(editor, ''); TinyAssertions.assertSelection(editor, [ 0, 0, 0 ], 0, [ 0, 0, 0 ], 0); }); it('TBA: alpha to ul, selection from parent to sublist', () => { const editor = hook.editor(); editor.setContent('
  1. a
    1. b
'); TinySelections.setSelection(editor, [ 0, 0, 0 ], 0, [ 0, 1, 0, 0 ], 1); TinyUiActions.clickOnToolbar(editor, 'button[aria-label="Bullet list"]'); TinyAssertions.assertContent(editor, ''); TinyAssertions.assertSelection(editor, [ 0, 0, 0 ], 0, [ 0, 1, 0, 0 ], 1); }); });