import { Pipeline } from '@ephox/agar'; import { LegacyUnit } from '@ephox/mcagar'; import DOMUtils from 'tinymce/core/api/dom/DOMUtils'; import DomParser from 'tinymce/core/api/html/DomParser'; import Schema from 'tinymce/core/api/html/Schema'; import InsertList from 'tinymce/core/InsertList'; import { UnitTest } from '@ephox/bedrock'; UnitTest.asynctest('browser.tinymce.core.InsertListTest', function () { const success = arguments[arguments.length - 2]; const failure = arguments[arguments.length - 1]; const suite = LegacyUnit.createSuite(); const schema = Schema({}); const createFragment = function (html) { const parser = DomParser({ validate: false }); const fragment = parser.parse(html); return fragment; }; const createDomFragment = function (html) { return DOMUtils.DOM.createFragment(html); }; suite.test('isListFragment', function () { LegacyUnit.equal(InsertList.isListFragment(schema, createFragment('
\u00a0
')), true); LegacyUnit.equal(InsertList.isListFragment(schema, createFragment('x
')), false); LegacyUnit.equal(InsertList.isListFragment(schema, createFragment('')), false); }); suite.test('listItems', function () { const list = createDomFragment('