import { Assertions, GeneralSteps, Logger, Pipeline, Step } from '@ephox/agar'; import { TinyApis, TinyLoader } from '@ephox/mcagar'; import { Insert, Element, SelectorFind } from '@ephox/sugar'; import { UnitTest } from '@ephox/bedrock'; UnitTest.asynctest( 'browser.tinymce.core.init.InitEditorThemeFunctionIframeTest', function () { const success = arguments[arguments.length - 2]; const failure = arguments[arguments.length - 1]; TinyLoader.setup(function (editor, onSuccess, onFailure) { const tinyApis = TinyApis(editor); Pipeline.async({}, [ Logger.t('Tests if the editor is responsive after setting theme to a function', GeneralSteps.sequence([ tinyApis.sSetContent('
a
'), tinyApis.sAssertContent('a
') ])), Logger.t('Editor element properties', Step.sync(function () { const body = Element.fromDom(document.body); const editorElement = SelectorFind.descendant(body, '#' + editor.id + '_parent').getOrDie('No elm'); const iframeContainerElement = SelectorFind.descendant(body, '#' + editor.id + '_iframecontainer').getOrDie('No elm'); Assertions.assertDomEq('Should be expected editor container element', editorElement, Element.fromDom(editor.editorContainer)); Assertions.assertDomEq('Should be expected iframe container element element', iframeContainerElement, Element.fromDom(editor.contentAreaContainer)); })) ], onSuccess, onFailure); }, { theme (editor, target) { const elm = Element.fromHtml('