OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
reader
/
_backup
/
tinymce
/
tinymce
/
src
/
core
/
test
/
ts
/
browser
/
init
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
02/20/2020 06:14:55 AM
rwxr-xr-x
📄
ContentCssTest.ts
2.67 KB
02/20/2020 06:14:11 AM
rw-r--r--
📄
ContentStylePositionTest.ts
1.3 KB
02/20/2020 06:14:11 AM
rw-r--r--
📄
EditorCustomThemeTest.ts
1.83 KB
02/20/2020 06:14:12 AM
rw-r--r--
📄
EditorInitializationTest.ts
8.06 KB
02/20/2020 06:14:12 AM
rw-r--r--
📄
InitEditorIconTest.ts
1.73 KB
02/20/2020 06:14:13 AM
rw-r--r--
📄
InitEditorNoThemeIframeTest.ts
1.65 KB
02/20/2020 06:14:13 AM
rw-r--r--
📄
InitEditorNoThemeInlineTest.ts
1.88 KB
02/20/2020 06:14:14 AM
rw-r--r--
📄
InitEditorOnHiddenElementTest.ts
705 bytes
02/20/2020 06:14:14 AM
rw-r--r--
📄
InitEditorPluginInitErrorTest.ts
1.69 KB
02/20/2020 06:14:15 AM
rw-r--r--
📄
InitEditorThemeFunctionIframeTest.ts
1.96 KB
02/20/2020 06:14:15 AM
rw-r--r--
📄
InitEditorThemeFunctionInlineTest.ts
2.05 KB
02/20/2020 06:14:16 AM
rw-r--r--
📄
InitIframeEditorWithCustomAttrsTest.ts
1.26 KB
02/20/2020 06:14:16 AM
rw-r--r--
Editing: ContentCssTest.ts
Close
import { RawAssertions } from '@ephox/agar'; import { UnitTest } from '@ephox/bedrock'; import EditorManager from 'tinymce/core/api/EditorManager'; import Editor from 'tinymce/core/api/Editor'; import { appendContentCssFromSettings } from 'tinymce/core/init/ContentCss'; UnitTest.test('browser.tinymce.core.init.ContentCssTest', () => { const baseUrl = EditorManager.documentBaseURL.replace(/\/$/, ''); const skinsBaseUrl = EditorManager.baseURL + '/skins/content'; const testContentCss = (label: string, expectedContentCss: string[], inputContentCss: string[] | string | boolean) => { const editor = new Editor('id', { content_css: inputContentCss }, EditorManager); appendContentCssFromSettings(editor); RawAssertions.assertEq(label, expectedContentCss, editor.contentCSS); }; testContentCss('Expected empty array on empty input', [], []); testContentCss('Expected empty array on boolean false value', [], false); testContentCss('Expected default content css on undefined value', [`${skinsBaseUrl}/default/content.css`], undefined); testContentCss('Expected array with absolute url from .css file name', [`${baseUrl}/test.css`], 'test.css'); testContentCss('Expected array with absolute url from relative string', [`${baseUrl}/content/test.css`], '/content/test.css'); testContentCss('Expected array with absolute url from array with relative string', [`${baseUrl}/content/test.css`], ['/content/test.css']); testContentCss('Expected array with two absolute urls from an array of relative strings', [`${baseUrl}/content/a.css`, `${baseUrl}/content/b.css`], ['/content/a.css', '/content/b.css'] ); testContentCss('Expected array with absolute url from absolute string', ['http://localhost/a/b/test.css'], 'http://localhost/a/b/test.css'); testContentCss('Expected array with absolute url from string with skin name', [`${skinsBaseUrl}/document/content.css`], 'document'); testContentCss('Expected array with absolute url from array with skin name', [`${skinsBaseUrl}/document/content.css`], ['document']); testContentCss('Expected array with absolute url from string with skin name with dash', [`${skinsBaseUrl}/business-letter/content.css`], 'business-letter'); testContentCss('Expected empty array on empty input', [], []); testContentCss('Expected array with absolute url from a comma separated list of css files', [`${baseUrl}/a.css`, `${baseUrl}/b.css`], 'a.css,b.css' ); const inlineEditor = new Editor('id', { content_css: 'document', inline: true }, EditorManager); appendContentCssFromSettings(inlineEditor); RawAssertions.assertEq('Content skins should not load in inline mode', [`${baseUrl}/document`], inlineEditor.contentCSS); });