Add smart ACK provider for WeChat MP replies
Replace fixed ackText with a rule-based AckProvider that picks response templates by message type and intent (translate, summary, rewrite, poster, ppt, mindmap, code, search, schedule). Pure sync, zero I/O, auto-falls back to config.ackText on any error. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { renderPlazaPostRedirectHtml } from './plaza-public.mjs';
|
||||
|
||||
test('plaza post shell embeds publication with resilient height sync', () => {
|
||||
const html = renderPlazaPostRedirectHtml(
|
||||
{ id: 'post-1', title: 'Tall post', summary: 'A tall publication' },
|
||||
'https://go.tkmind.cn/u/john/pages/tall',
|
||||
);
|
||||
|
||||
assert.match(html, /src="https:\/\/go\.tkmind\.cn\/u\/john\/pages\/tall\?embed=plaza"/);
|
||||
assert.match(html, /function measureFrameDocument\(\)/);
|
||||
assert.match(html, /body\.children\.length/);
|
||||
assert.match(html, /event\.source !== frame\.contentWindow/);
|
||||
assert.match(html, /sandbox="allow-scripts"/);
|
||||
assert.doesNotMatch(html, /sandbox="allow-same-origin allow-scripts"/);
|
||||
});
|
||||
Reference in New Issue
Block a user