Files
memind/mindspace-html-localize.test.mjs
John 2e14873f2d Initial commit: Memind H5 portal with MindSpace, Plaza, and agent jobs.
Track application source and tests; exclude local env, user workspaces, and runtime data via .gitignore.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-15 15:04:43 -07:00

16 lines
677 B
JavaScript

import assert from 'node:assert/strict';
import test from 'node:test';
import { localizeGoogleFontsCss } from './mindspace-html-localize.mjs';
test('localizeGoogleFontsCss inlines google fonts imports', async () => {
const source = `<!doctype html><html><head><style>
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC&display=swap');
body { color: red; }
</style></head><body>Hi</body></html>`;
const result = await localizeGoogleFontsCss(source);
assert.equal(result.localizedCount, 1);
assert.match(result.html, /data-mindspace-local="google-fonts"/);
assert.doesNotMatch(result.html, /@import\s+url\(['"]?https:\/\/fonts\.googleapis\.com/);
});