进行了一些小修复
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
'use strict';
|
||||
|
||||
const assert = require('node:assert/strict');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
const test = require('node:test');
|
||||
|
||||
const root = path.resolve(__dirname, '..', '..');
|
||||
const read = (file) => fs.readFileSync(path.join(root, file), 'utf8');
|
||||
|
||||
test('comment smilie assets and their runtime chain stay removed', () => {
|
||||
assert.equal(
|
||||
fs.existsSync(path.join(root, 'assets/img/smilies')),
|
||||
false,
|
||||
'the bundled comment smilie directory must not exist'
|
||||
);
|
||||
|
||||
const files = [
|
||||
'assets/admin/src/schema/sections/post-list/comment.js',
|
||||
'assets/css/build/public.css',
|
||||
'assets/css/build/public.min.css',
|
||||
'assets/css/main.css',
|
||||
'assets/css/main.min.css',
|
||||
'assets/js/build/public.js',
|
||||
'assets/js/comment-tools.js',
|
||||
'assets/js/enhancements.js',
|
||||
'assets/js/runtime/imgbox.js',
|
||||
'assets/js/runtime/imgbox.min.js',
|
||||
'assets/js/runtime/input-expand.js',
|
||||
'assets/js/runtime/input-expand.min.js',
|
||||
'assets/js/runtime/main.js',
|
||||
'assets/js/runtime/main.min.js',
|
||||
'inc/helpers/aksrt-comments.php',
|
||||
'inc/helpers/comments/content.php',
|
||||
'inc/helpers/comments/form-parts.php',
|
||||
'src/Admin/Schema/SchemaPostList.php',
|
||||
'src/Core/ScriptsPart1c.php',
|
||||
'src/Settings/PostDisplay.php',
|
||||
];
|
||||
const forbidden = [
|
||||
'comment_smilie',
|
||||
'commentSmiliesBase',
|
||||
'aksrt_comment_smilie',
|
||||
'assets/img/smilies',
|
||||
'data-smilie',
|
||||
'dropdown-smilie',
|
||||
'smilie-icon',
|
||||
'[g=',
|
||||
];
|
||||
|
||||
for (const file of files) {
|
||||
const source = read(file);
|
||||
for (const token of forbidden) {
|
||||
assert.equal(source.includes(token), false, `${file} must not contain ${token}`);
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user