Skip to content

Commit eed7cbc

Browse files
test(decompose): cover visual parity source image seed
Signed-off-by: Sun-sunshine06 <Sun-sunshine06@users.noreply.github.com>
1 parent bcfe780 commit eed7cbc

2 files changed

Lines changed: 29 additions & 0 deletions

File tree

apps/desktop/src/main/index.workspace.test.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,33 @@ describe('createRuntimeTextEditorFs', () => {
203203
expect(listFsUpdatedEvents(sendEvent)).toHaveLength(0);
204204
});
205205

206+
it('seeds the first image attachment as source.png for visual parity checks', () => {
207+
const db = initInMemoryDb();
208+
const design = createDesign(db, 'Visual Parity Source Workspace');
209+
const sendEvent = vi.fn();
210+
const logger = { error: vi.fn() };
211+
const { fs } = createRuntimeTextEditorFs({
212+
db,
213+
designId: design.id,
214+
generationId: 'gen-visual-source',
215+
logger,
216+
previousSource: null,
217+
attachments: [
218+
{
219+
name: 'shot.png',
220+
path: 'references/shot.png',
221+
mediaType: 'image/png',
222+
imageDataUrl: PNG_HEADER_DATA_URL,
223+
},
224+
],
225+
sendEvent,
226+
});
227+
228+
expect(fs.view('source.png')?.content).toBe(PNG_HEADER_DATA_URL);
229+
expect(fs.view('references/shot.png')?.content).toContain('Reference image: shot.png');
230+
expect(listFsUpdatedEvents(sendEvent)).toHaveLength(0);
231+
});
232+
206233
it('seeds previous source into App.jsx when no workspace source exists yet', () => {
207234
const db = initInMemoryDb();
208235
const design = createDesign(db, 'Seed Previous Source');

packages/core/src/agent.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1805,6 +1805,8 @@ describe('generateViaAgent()', () => {
18051805
'scaffold',
18061806
'inspect_workspace',
18071807
'str_replace_based_edit_tool',
1808+
'decompose_to_ui_kit',
1809+
'verify_ui_kit_parity',
18081810
'done',
18091811
'preview',
18101812
'generate_image_asset',

0 commit comments

Comments
 (0)