进行了一些小修复
This commit is contained in:
@@ -49,6 +49,29 @@ test('front submit follows the reference newposts shell and cards', () => {
|
||||
assert.match(submit, /new-posts-submit/);
|
||||
});
|
||||
|
||||
test('front submit image and visibility actions live in the TinyMCE toolbar', () => {
|
||||
const main = read('templates/parts/submit/editor-main.php');
|
||||
const page = read('templates/pages/page-submit.php');
|
||||
const submit = read('assets/js/front-submit.js');
|
||||
const editor = read('assets/js/front-submit-editor.js');
|
||||
|
||||
assert.match(main, /\$toolbar1\[\]\s*=\s*'aksrt_image'/);
|
||||
assert.match(main, /\$toolbar1\[\]\s*=\s*'aksrt_hide'/);
|
||||
assert.match(main, /mce_external_plugins/);
|
||||
assert.match(main, /aksrt_editor_tools/);
|
||||
assert.match(editor, /PluginManager\.add\('aksrt_editor_tools'/);
|
||||
assert.match(editor, /addButton\('aksrt_image'/);
|
||||
assert.match(editor, /addButton\('aksrt_hide'/);
|
||||
assert.match(editor, /type:\s*'menubutton'/);
|
||||
assert.match(editor, /data-editor-media-tab="upload"/);
|
||||
assert.match(editor, /data-editor-media-tab="external"/);
|
||||
assert.match(editor, /\(cfg\.uploads \|\| \{\}\)\.image/);
|
||||
assert.match(page, /'canUploadImage'\s*=>\s*!empty\(\$ctx\['can_upload_img'\]\)/);
|
||||
assert.doesNotMatch(main, /newposts-editor-tools|data-insert-shortcode|data-insert-upload-image/);
|
||||
assert.doesNotMatch(submit, /bindShortcodes|data-insert-shortcode|data-insert-upload-image/);
|
||||
assert.doesNotMatch(editor, /hidecontent|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 = [
|
||||
|
||||
@@ -369,6 +369,8 @@ test('settings actions use rehydrated fixed-id notyf flows', () => {
|
||||
|
||||
test('front submit actions use direct fixed-id notyf flows', () => {
|
||||
const submit = read('assets/js/front-submit.js');
|
||||
const editor = read('assets/js/front-submit-editor.js');
|
||||
const source = submit + '\n' + editor;
|
||||
const page = read('templates/pages/page-submit.php');
|
||||
|
||||
[
|
||||
@@ -382,7 +384,7 @@ test('front submit actions use direct fixed-id notyf flows', () => {
|
||||
'aksrt-front-submit-editor-image-toast',
|
||||
'aksrt-front-submit-ai-tags-toast',
|
||||
'aksrt-front-submit-ai-summary-toast',
|
||||
].forEach((id) => assert.match(submit, new RegExp("['\"]" + id + "['\"]")));
|
||||
].forEach((id) => assert.match(source, new RegExp("['\"]" + id + "['\"]")));
|
||||
|
||||
assert.match(submit, /submit: function[\s\S]*?notyf\([^;]+?'load'[^;]+?toastId[\s\S]*?notyf\([^;]+?'success'[^;]+?toastId[\s\S]*?notyf\([^;]+?'danger'[^;]+?toastId/);
|
||||
assert.match(submit, /bindDraftDelete: function[\s\S]*?'aksrt-front-submit-delete-draft-toast'[\s\S]*?'load'[\s\S]*?'success'[\s\S]*?'danger'/);
|
||||
@@ -398,7 +400,7 @@ test('front submit actions use direct fixed-id notyf flows', () => {
|
||||
});
|
||||
|
||||
assert.match(submit, /aksrt-front-submit-resource-upload-toast[\s\S]*?'load'[\s\S]*?'success'[\s\S]*?'danger'/);
|
||||
assert.match(submit, /aksrt-front-submit-editor-image-toast[\s\S]*?'load'[\s\S]*?'success'[\s\S]*?'danger'/);
|
||||
assert.match(editor, /aksrt-front-submit-editor-image-toast[\s\S]*?'load'[\s\S]*?'success'[\s\S]*?'danger'/);
|
||||
assert.match(submit, /aksrt-front-submit-ai-tags-toast[\s\S]*?aksrt-front-submit-ai-summary-toast[\s\S]*?'load'[\s\S]*?'success'[\s\S]*?'danger'/);
|
||||
assert.match(submit, /needContent[^;]+?'warning'/);
|
||||
assert.doesNotMatch(submit, /\b(?:window\.)?alert\s*\(/);
|
||||
|
||||
Reference in New Issue
Block a user