const test = require('node:test'); const assert = require('node:assert/strict'); const fs = require('node:fs'); const path = require('node:path'); const root = path.resolve(__dirname, '..', '..'); const read = (file) => fs.readFileSync(path.join(root, file), 'utf8'); test('article and modern widget yiyan use the reference bilingual quote source and interactions', () => { const helper = read('inc/helpers/aksrt-yiyan.php'); const client = read('assets/js/yiyan.js'); const widgetClient = read('assets/widgets/frontend.js'); const renderer = read('src/WidgetSystem/Renderers/GeneralRenderer.php'); const rest = read('src/WidgetSystem/RestController.php'); const schema = read('src/WidgetSystem/WidgetSchemas.php'); const widgetStyles = read('assets/widgets/frontend.css'); const catalog = read('yiyan/qv-yiyan.txt').split(/\r?\n/).filter(Boolean); assert.match(helper, /WP_CONTENT_DIR\s*\.\s*'\/yiyan\.txt'/); assert.match(helper, /\/yiyan\/qv-yiyan\.txt/); assert.match(helper, /wp_ajax_nopriv_aksrt_yiyan/); assert.match(helper, /'en'\s*=>\s*\$lines\[\$i\],\s*'cn'\s*=>\s*\$lines\[\$i\s*\+\s*1\]/); assert.match(helper, /class="yiyan">