16 lines
688 B
JavaScript
16 lines
688 B
JavaScript
const { test } = require('node:test');
|
|
const assert = require('node:assert/strict');
|
|
const path = require('node:path');
|
|
const { pathToFileURL } = require('node:url');
|
|
|
|
async function sourcesModule() {
|
|
return import(pathToFileURL(path.join(__dirname, '..', 'public/js/assistant/sources.js')).href);
|
|
}
|
|
|
|
test('assistant source excerpts hide image markdown but keep OCR text', async () => {
|
|
const { renderSourcesList } = await sourcesModule();
|
|
const html = renderSourcesList([{ title: 'Nelson', excerpt: ' AGE STREAMS OF DEVELOPMENT' }]);
|
|
|
|
assert.match(html, /AGE STREAMS OF DEVELOPMENT/);
|
|
assert.doesNotMatch(html, /tmp\/pdf-images|!\[\]/);
|
|
});
|