import assert from 'node:assert/strict'; import test from 'node:test'; import { applyWechatSurveyCompat, htmlNeedsWechatSurveyCompat, } from './mindspace-page-data-wechat-survey-compat.mjs'; const SURVEY_HTML = ` `; test('htmlNeedsWechatSurveyCompat detects pointer-events none on survey radios', () => { assert.equal(htmlNeedsWechatSurveyCompat(SURVEY_HTML), true); assert.equal(htmlNeedsWechatSurveyCompat('plain'), false); }); test('applyWechatSurveyCompat removes pointer-events none from radio inputs', () => { const result = applyWechatSurveyCompat(SURVEY_HTML); assert.equal(result.patched, true); assert.doesNotMatch(result.html, /\.genre-option\s+input\s*\{[^}]*pointer-events\s*:\s*none/i); assert.match(result.html, /mindspace-wechat-survey-compat/); assert.match(result.html, /z-index:\s*2/); });