You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test: align file-preview tests with #524 and #526 (#527)
* test: align file-preview tests with #524 and #526
Two tests trailed the latest contract changes:
- test-file-handlers.js: #526 dropped structuredContent.imageData and
carries the image base64 only in structuredContent.content. Update the
image/SVG assertions to read content instead of the removed field.
- test-markdown-preview.js: #524 tags read_file calls with origin:'ui'.
The Test 9 and Test 11 mocks asserted exact read_file args via
deepStrictEqual; add origin:'ui' so the full-document reload and the
failed-save resync paths match again.
No source changes; both were stale tests, not regressions.
* Release v0.2.43
Automated release commit with version bump from 0.2.42 to 0.2.43
Copy file name to clipboardExpand all lines: test/test-file-handlers.js
+4-5Lines changed: 4 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -333,9 +333,8 @@ async function testReadFilePreviewMetadata() {
333
333
assert.ok(typeofimageContentItem.data==='string'&&imageContentItem.data.length>0,'Image content item should carry non-empty base64 data');
334
334
assert.ok(imageResult.structuredContent,'Image should include structuredContent');
335
335
assert.strictEqual(imageResult.structuredContent.fileType,'image','Image fileType should map to image preview state');
336
-
assert.strictEqual(typeofimageResult.structuredContent.imageData,'string','Image structured payload should include imageData');
337
-
assert.ok(imageResult.structuredContent.imageData.length>0,'Image structured payload should include non-empty imageData');
338
-
assert.strictEqual(imageResult.structuredContent.content,imageResult.structuredContent.imageData,'Image structuredContent should include file content');
336
+
assert.strictEqual(typeofimageResult.structuredContent.content,'string','Image structured payload should carry base64 in content');
337
+
assert.ok(imageResult.structuredContent.content.length>0,'Image structured payload should include non-empty content');
339
338
assert.strictEqual(imageResult.structuredContent.mimeType,'image/png','Image structured payload should include mimeType');
340
339
assert.strictEqual(imageResult.structuredContent.filePath,IMAGE_FILE,'Image file path should be present');
341
340
assert.strictEqual(imageResult.structuredContent.sourceTool,'read_file','Image preview should preserve source tool');
@@ -349,8 +348,8 @@ async function testReadFilePreviewMetadata() {
349
348
assert.ok(svgResult.structuredContent,'SVG should include structuredContent');
350
349
assert.strictEqual(svgResult.structuredContent.fileType,'image','SVG should map to image preview state');
351
350
assert.strictEqual(svgResult.structuredContent.mimeType,'image/svg+xml','SVG structured payload should include SVG mimeType');
352
-
assert.strictEqual(typeofsvgResult.structuredContent.imageData,'string','SVG structured payload should include imageData');
353
-
assert.ok(svgResult.structuredContent.imageData.length>0,'SVG structured payload should include non-empty imageData');
351
+
assert.strictEqual(typeofsvgResult.structuredContent.content,'string','SVG structured payload should carry base64 in content');
352
+
assert.ok(svgResult.structuredContent.content.length>0,'SVG structured payload should include non-empty content');
354
353
assert.strictEqual(svgResult.structuredContent.sourceTool,'read_file','SVG preview should preserve source tool');
355
354
356
355
constwriteResult=awaithandleWriteFile({path: TEXT_FILE,content: 'written through handler'});
0 commit comments