Files
memind/plaza-public.test.mjs
john 9b4a25799f 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>
2026-06-26 15:19:03 +08:00

18 lines
775 B
JavaScript

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"/);
});