pediatric-ai-scribe-v3/test/assistant-image-intent.test.js
Daniel 2942d4f6b3
All checks were successful
Forgejo Android APK / Build signed APK (push) Successful in 1m43s
Revert "Sanitize citations from clinical image prompts"
This reverts commit 7833018695.
2026-09-02 01:50:44 +02:00

20 lines
850 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 imagesModule() {
return import(pathToFileURL(path.join(__dirname, '..', 'public/js/assistant/images.js')).href);
}
test('assistant image intent does not intercept table retrieval requests', async () => {
const { isImageRequest } = await imagesModule();
assert.equal(isImageRequest('can you show me the table?'), false);
assert.equal(isImageRequest('show me Table 13.1'), false);
});
test('assistant image intent still handles explicit visual requests', async () => {
const { isImageRequest } = await imagesModule();
assert.equal(isImageRequest('show me the diagram'), true);
assert.equal(isImageRequest('create an infographic for asthma'), true);
});