进行了一些小修复
This commit is contained in:
@@ -75,6 +75,46 @@ test('front submit image and visibility actions live in the TinyMCE toolbar', ()
|
||||
assert.doesNotMatch(editor, /hidecontent|shop|forum|bbs_/i);
|
||||
});
|
||||
|
||||
test('front submit exposes the complete reference media and formatting toolset', () => {
|
||||
const main = read('templates/parts/submit/editor-main.php');
|
||||
const page = read('templates/pages/page-submit.php');
|
||||
const editor = read('assets/js/front-submit-editor.js');
|
||||
const editorCss = read('assets/css/frontend/pages/submit-editor.css');
|
||||
const submit = read('src/Core/FrontSubmit.php');
|
||||
|
||||
['aksrt_video', 'aksrt_file', 'aksrt_quote', 'aksrt_precode'].forEach((button) => {
|
||||
assert.match(main, new RegExp(`['"]${button}['"]`));
|
||||
assert.match(editor, new RegExp(`addButton\\(['"]${button}['"]`));
|
||||
});
|
||||
assert.doesNotMatch(main, /array_merge\(\$toolbar1, \['blockquote'/);
|
||||
assert.match(main, /toolbar2[\s\S]*forecolor/);
|
||||
assert.match(main, /colorpicker,textcolor/);
|
||||
|
||||
assert.match(page, /'canUploadVideo'\s*=>\s*!empty\(\$ctx\['can_upload_video'\]\)/);
|
||||
assert.match(page, /'canEmbedVideo'\s*=>\s*!empty\(\$ctx\['can_iframe'\]\)/);
|
||||
assert.match(page, /'canUploadFile'\s*=>\s*!empty\(\$ctx\['can_upload_file'\]\)/);
|
||||
assert.match(page, /'video'\s*=>\s*!empty\(\$ctx\['can_upload_video'\]\)/);
|
||||
assert.match(submit, /\(\?P<kind>image\|video\|resource\)/);
|
||||
assert.match(submit, /new_post_upload_video/);
|
||||
|
||||
assert.match(editor, /data-editor-media-tab="upload"/);
|
||||
assert.match(editor, /data-editor-media-tab="external"/);
|
||||
assert.match(editor, /data-editor-media-tab="embed"/);
|
||||
assert.match(editor, /new-dplayer post-dplayer dplayer/);
|
||||
assert.match(editor, /file-download-box/);
|
||||
assert.match(editor, /wp-block-embed is-type-video/);
|
||||
assert.match(editor, /data-enlighter-language/);
|
||||
assert.match(editor, /data-enlighter-theme/);
|
||||
assert.match(editor, /enlighter-pre/);
|
||||
assert.match(editor, /qe_wzk_c-red/);
|
||||
assert.match(editor, /qe_wzk_lan/);
|
||||
assert.match(editor, /qe_wzk_lv/);
|
||||
assert.match(editorCss, /\.quote_q/);
|
||||
assert.match(editorCss, /\.file-download-box/);
|
||||
assert.match(editorCss, /\.enlighter-pre/);
|
||||
assert.doesNotMatch(editor, /shop|forum|bbs_/i);
|
||||
});
|
||||
|
||||
test('article paid-content metabox follows the reference field set without shop enhancements', () => {
|
||||
const meta = read('src/Core/ResourceMetaBox.php');
|
||||
const fields = [
|
||||
|
||||
Reference in New Issue
Block a user