PHP Classes

File: public/js/tinymce/src/plugins/charmap/src/test/js/browser/CharmapPluginTest.js

Recommend this page to a friend!
  Classes of Abed Nego Ragil Putra   GoLavaCMS   public/js/tinymce/src/plugins/charmap/src/test/js/browser/CharmapPluginTest.js   Download  
File: public/js/tinymce/src/plugins/charmap/src/test/js/browser/CharmapPluginTest.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,519 bytes
 

Contents

Class file image Download
asynctest( 'browser.tinymce.plugins.charmap.CharMapPluginTest', [ 'ephox.agar.api.Pipeline', 'ephox.mcagar.api.LegacyUnit', 'ephox.mcagar.api.TinyLoader', 'tinymce.plugins.charmap.Plugin', 'tinymce.themes.modern.Theme' ], function (Pipeline, LegacyUnit, TinyLoader, Plugin, Theme) { var success = arguments[arguments.length - 2]; var failure = arguments[arguments.length - 1]; var suite = LegacyUnit.createSuite(); Plugin(); Theme(); suite.test('Replace characters by array', function (editor) { editor.settings.charmap = [ [65, 'Latin A'], [66, 'Latin B'] ]; LegacyUnit.deepEqual(editor.plugins.charmap.getCharMap(), [ [65, 'Latin A'], [66, 'Latin B'] ]); }); suite.test('Replace characters by function', function (editor) { editor.settings.charmap = function () { return [ [65, 'Latin A fun'], [66, 'Latin B fun'] ]; }; LegacyUnit.deepEqual(editor.plugins.charmap.getCharMap(), [ [65, 'Latin A fun'], [66, 'Latin B fun'] ]); }); suite.test('Append characters by array', function (editor) { editor.settings.charmap = [ [67, 'Latin C'] ]; editor.settings.charmap_append = [ [65, 'Latin A'], [66, 'Latin B'] ]; LegacyUnit.deepEqual(editor.plugins.charmap.getCharMap(), [ [67, 'Latin C'], [65, 'Latin A'], [66, 'Latin B'] ]); }); suite.test('Append characters by function', function (editor) { editor.settings.charmap = [ [67, 'Latin C'] ]; editor.settings.charmap_append = function () { return [ [65, 'Latin A fun'], [66, 'Latin B fun'] ]; }; LegacyUnit.deepEqual(editor.plugins.charmap.getCharMap(), [ [67, 'Latin C'], [65, 'Latin A fun'], [66, 'Latin B fun'] ]); }); suite.test('Insert character', function (editor) { var lastEvt; editor.on('insertCustomChar', function (e) { lastEvt = e; }); editor.plugins.charmap.insertChar('A'); LegacyUnit.equal(lastEvt.chr, 'A'); }); TinyLoader.setup(function (editor, onSuccess, onFailure) { Pipeline.async({}, suite.toSteps(editor), onSuccess, onFailure); }, { plugins: 'charmap', indent: false, skin_url: '/project/src/skins/lightgray/dist/lightgray' }, success, failure); } );