PHP Classes

File: public/js/tinymce/src/plugins/image/src/test/js/browser/ImageListTest.js

Recommend this page to a friend!
  Classes of Abed Nego Ragil Putra   GoLavaCMS   public/js/tinymce/src/plugins/image/src/test/js/browser/ImageListTest.js   Download  
File: public/js/tinymce/src/plugins/image/src/test/js/browser/ImageListTest.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: GoLavaCMS
Publish content on Web pages with SEO support
Author: By
Last change:
Date: 6 years ago
Size: 2,993 bytes
 

Contents

Class file image Download
asynctest( 'browser.tinymce.plugins.image.ImageListTest', [ 'ephox.agar.api.Assertions', 'ephox.agar.api.Chain', 'ephox.agar.api.GeneralSteps', 'ephox.agar.api.Logger', 'ephox.agar.api.Mouse', 'ephox.agar.api.Pipeline', 'ephox.agar.api.UiControls', 'ephox.agar.api.UiFinder', 'ephox.mcagar.api.TinyApis', 'ephox.mcagar.api.TinyDom', 'ephox.mcagar.api.TinyLoader', 'ephox.mcagar.api.TinyUi', 'global!document', 'tinymce.core.dom.DOMUtils', 'tinymce.plugins.image.Plugin', 'tinymce.themes.modern.Theme' ], function (Assertions, Chain, GeneralSteps, Logger, Mouse, Pipeline, UiControls, UiFinder, TinyApis, TinyDom, TinyLoader, TinyUi, document, DOMUtils, ImagePlugin, ModernTheme) { var success = arguments[arguments.length - 2]; var failure = arguments[arguments.length - 1]; ModernTheme(); ImagePlugin(); var cFakeEvent = function (name) { return Chain.op(function (elm) { DOMUtils.DOM.fire(elm.dom(), name); }); }; TinyLoader.setup(function (editor, onSuccess, onFailure) { var tinyApis = TinyApis(editor); var tinyUi = TinyUi(editor); Pipeline.async({}, [ Logger.t('click image list, check that source changes, change source and check that image list changes', GeneralSteps.sequence([ tinyApis.sSetSetting('image_list', [ { title: 'Dog', value: 'mydog.jpg' }, { title: 'Cat', value: 'mycat.jpg' } ]), tinyUi.sClickOnToolbar('click image button', 'div[aria-label="Insert/edit image"] button'), Chain.asStep({}, [ tinyUi.cWaitForPopup('wait for dialog', 'div[role="dialog"]'), UiFinder.cFindIn('label:contains("Image list") + div > button'), Mouse.cClick ]), Chain.asStep(TinyDom.fromDom(document.body), [ UiFinder.cFindIn('div[role="menuitem"] > span:contains("Dog")'), Mouse.cClick ]), Chain.asStep({}, [ Chain.fromParent(tinyUi.cWaitForPopup('wait for dialog', 'div[role="dialog"]'), [ Chain.fromChains([ UiFinder.cFindIn('label:contains("Source") + div > input'), UiControls.cGetValue, Assertions.cAssertEq('should be dog', 'mydog.jpg') ]), Chain.fromChains([ UiFinder.cFindIn('label:contains("Source") + div > input'), UiControls.cSetValue('mycat.jpg'), cFakeEvent('change') ]), Chain.fromChains([ UiFinder.cFindIn('label:contains("Image list") + div > button > span:contains("Cat")') ]) ] ) ]) ])) ], onSuccess, onFailure); }, { plugins: 'image', toolbar: 'image', skin_url: '/project/src/skins/lightgray/dist/lightgray' }, success, failure); } );