import { describe, it } from '@ephox/bedrock-client'; import { TinyAssertions, TinyHooks, TinySelections } from '@ephox/wrap-mcagar'; import Editor from 'tinymce/core/api/Editor'; import Plugin from 'tinymce/plugins/table/Plugin'; import * as TableTestUtils from '../../module/test/TableTestUtils'; describe('browser.tinymce.plugins.table.TableClassListTest', () => { const hook = TinyHooks.bddSetupLight({ plugins: 'table', base_url: '/project/tinymce/js/tinymce' }, [ Plugin ], true); const tableHtml = '
x
'; it('TBA: no class input without setting', async () => { const editor = hook.editor(); editor.setContent(tableHtml); TinySelections.setSelection(editor, [ 0, 0, 0, 0, 0 ], 0, [ 0, 0, 0, 0, 0 ], 1); editor.execCommand('mceTableProps'); await TableTestUtils.pAssertDialogPresence( 'Checking that class label is not present', editor, { 'label:contains("Class")': 0 } ); await TableTestUtils.pClickDialogButton(editor, false); }); it('TBA: class input with setting', async () => { const editor = hook.editor(); editor.options.set('table_class_list', [{ title: 'test', value: 'test' }]); editor.setContent(tableHtml); TinySelections.setSelection(editor, [ 0, 0, 0, 0, 0 ], 0, [ 0, 0, 0, 0, 0 ], 1); // FIX: Dupe with TableCellClassListTest. editor.execCommand('mceTableProps'); await TableTestUtils.pAssertListBoxValue('Select class', editor, 'Class', 'test'); await TableTestUtils.pClickDialogButton(editor, true); TinyAssertions.assertContentPresence(editor, { 'table.test': 1 }); }); });