From 7f707cfef595d0100e85dbd1e1f9fa7386f3933b Mon Sep 17 00:00:00 2001 From: dante01yoon Date: Fri, 5 Jun 2026 23:36:01 +0900 Subject: [PATCH] test: verify on-node grid cells request thumbnail previews (FE-741) --- .../interactions/node/imagePreview.spec.ts | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/browser_tests/tests/vueNodes/interactions/node/imagePreview.spec.ts b/browser_tests/tests/vueNodes/interactions/node/imagePreview.spec.ts index fa8c0d5415..a3003d088a 100644 --- a/browser_tests/tests/vueNodes/interactions/node/imagePreview.spec.ts +++ b/browser_tests/tests/vueNodes/interactions/node/imagePreview.spec.ts @@ -180,4 +180,44 @@ test.describe('Vue Nodes Batch Image Preview', { tag: '@vue-nodes' }, () => { await expect.poll(() => countColumns(node.imageGrid)).toBeLessThan(10) } ) + + wstest( + 'requests lightweight thumbnail URLs for grid cells', + async ({ comfyPage, getWebSocket }) => { + const execution = new ExecutionHelper(comfyPage, await getWebSocket()) + + await test.step('Add node', async () => { + await comfyPage.menu.topbar.newWorkflowButton.click() + await comfyPage.nextFrame() + + await comfyPage.searchBoxV2.addNode('Preview Image') + const previewImage = comfyPage.vueNodes.getNodeByTitle('Preview Image') + await expect(previewImage).toBeVisible() + }) + + const node = await comfyPage.vueNodes.getFixtureByTitle('Preview Image') + const gridImages = node.imageGrid.locator('img') + + await test.step('Inject a multi-image grid', async () => { + const images = Array.from({ length: 4 }, (_, index) => ({ + filename: `grid-${index}.png`, + subfolder: '', + type: 'output' + })) + execution.executed('', '1', { images }) + await expect(gridImages).toHaveCount(4) + }) + + // FE-741: small on-node grid cells must request a server re-encoded + // thumbnail (`preview=webp;75`, `;` may be percent-encoded) instead of + // downloading the full-resolution image, while still pointing at the + // real `/api/view` URL for that output. Verifies the full path: WS + // output -> nodeOutputStore.buildImageUrls -> getGridThumbnailUrl -> + // rendered grid ``. + for (const cell of await gridImages.all()) { + await expect(cell).toHaveAttribute('src', /[?&]preview=webp(%3B|;)75/) + await expect(cell).toHaveAttribute('src', /[?&]filename=grid-\d+\.png/) + } + } + ) })