fix: merged suite expectations for compact learning family and session-only offbox image
This commit is contained in:
parent
6be2d1375a
commit
809e7d5a67
2 changed files with 6 additions and 4 deletions
|
|
@ -70,9 +70,11 @@ test('compact prompt families separate the whole catalogue, display inert exact
|
|||
const scribe = familyOf(ui, 'scribe');
|
||||
const textFamily = familyOf(ui, 'clinical-text');
|
||||
const imageFamily = familyOf(ui, 'clinical-image');
|
||||
const learningFamily = familyOf(ui, 'learning-image');
|
||||
assert.equal(selectOf(scribe).options.length, 29);
|
||||
assert.equal(selectOf(textFamily).options.length, 1);
|
||||
assert.equal(selectOf(imageFamily).options.length, 1);
|
||||
assert.equal(selectOf(learningFamily).options.length, 1);
|
||||
assert.equal(ui.document.querySelector('script, img, [onerror]'), null);
|
||||
assert.match(scribe.closest('.card').textContent, /AI Scribe/);
|
||||
assert.equal(selectOf(scribe).value, catalogue[0].dbKey, 'first prompt selected by default');
|
||||
|
|
@ -80,7 +82,7 @@ test('compact prompt families separate the whole catalogue, display inert exact
|
|||
assert.equal(draftOf(scribe).value, unsafe);
|
||||
for (const name of ['save', 'history', 'view', 'restore', 'reset', 'baseline']) assert.ok(actionOf(scribe, name));
|
||||
for (const p of [catalogue[0], catalogue[1], ...catalogue.slice(-2)]) {
|
||||
const f = p.family === 'scribe' ? scribe : p.family === 'clinical-text' ? textFamily : imageFamily;
|
||||
const f = p.family === 'scribe' ? scribe : p.family === 'clinical-text' ? textFamily : p.family === 'clinical-image' ? imageFamily : learningFamily;
|
||||
await choosePrompt(f, p.dbKey);
|
||||
assert.equal(draftOf(f).value, unsafe);
|
||||
draftOf(f).value = '\n' + unsafe + '\n';
|
||||
|
|
@ -108,7 +110,7 @@ test('history/view/restore/reset use exact per-key APIs for every family and nev
|
|||
draftOf(scribe).value = 'Unrelated unsaved Scribe draft';
|
||||
await choosePrompt(scribe, catalogue[0].dbKey);
|
||||
for (const p of [catalogue[0], ...catalogue.slice(-2)]) {
|
||||
const f = p.family === 'scribe' ? scribe : p.family === 'clinical-text' ? familyOf(ui, 'clinical-text') : familyOf(ui, 'clinical-image');
|
||||
const f = p.family === 'scribe' ? scribe : p.family === 'clinical-text' ? familyOf(ui, 'clinical-text') : p.family === 'clinical-image' ? familyOf(ui, 'clinical-image') : familyOf(ui, 'learning-image');
|
||||
await choosePrompt(f, p.dbKey);
|
||||
const base = '/api/admin/config/prompts/' + p.dbKey;
|
||||
draftOf(f).value = 'Unsaved clinical/Scribe edits';
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ test('selected sidebar B survives A-done -> B-queued -> save/reopen/export, with
|
|||
const transcript=[{role:'assistant',content:'Original [3, 1].',sources:[{number:3,page:19}],imageJobs:[{jobId:id}]}];
|
||||
ui.context.restoreSavedChat({messages:transcript,lastAnswer:'Original [3, 1].',generatedImage:src});
|
||||
ui.context.generateImage('B request');await new Promise(r=>setImmediate(r));await ui.context.saveCurrentChat();
|
||||
assert.equal(saved.generatedImage,'','B queue must clear stale A asset');assert.equal(saved.generatedImageJobs[0].jobId,b);assert.equal(saved.messages[0].imageJobs[0].jobId,id);
|
||||
assert.equal(saved.generatedImage, undefined, 'offbox image is session-only and never saved');assert.equal(saved.generatedImageJobs[0].jobId,b);assert.equal(saved.messages[0].imageJobs[0].jobId,id);
|
||||
ui.context.restoreSavedChat(saved);await new Promise(r=>setImmediate(r));assert.equal(ui.context.lastGeneratedImageSrc,'');
|
||||
vm.runInContext(fs.readFileSync('public/js/assistant/export.js','utf8').replace(/^import .*;\n/gm,'').replace(/^export /gm,''),ui.context);
|
||||
ui.context.imageDataUrl=async url=>'data-for:'+url;
|
||||
|
|
@ -140,7 +140,7 @@ test('selected sidebar B survives A-done -> B-queued -> save/reopen/export, with
|
|||
assert.equal(ui.context.lastGeneratedImageSrc,'/api/generated-images/'+b);
|
||||
const exported=await ui.context.preparePrivateExport(state(),exportOwner);assert.equal(exported.lastGeneratedImageSrc,'data-for:/api/generated-images/'+b);
|
||||
assert.equal(exported.messages[0].images[0],'data-for:'+src);assert.equal(exported.messages[0].content,transcript[0].content);
|
||||
await ui.context.saveCurrentChat();assert.equal(saved.generatedImage,'/api/generated-images/'+b);ui.dom.window.close();
|
||||
await ui.context.saveCurrentChat();assert.equal(saved.generatedImage,undefined,'offbox image stays session-only even after job completes');assert.equal(saved.generatedImageJobs[0].jobId,b);ui.dom.window.close();
|
||||
});
|
||||
test('actual CMS presentation image controls are visible and insertion/save/reopen preserve Markdown; preserved refinement never resets editor', async () => {
|
||||
const ui=client();ui.dom.window.document.body.innerHTML='<style>.hidden{display:none!important}</style>'+fs.readFileSync('public/components/cms.html','utf8');
|
||||
|
|
|
|||
Loading…
Reference in a new issue