Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions browser_tests/fixtures/data/agent/agentStageFrames.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,26 @@ export const STAGE_FRAMES_CATALOG: WidgetCatalog = {
export const STAGE_FRAMES_INSERT_OPS: RecordedGraphOperation[] = [
{ op: 'insert_workflow', workflow: STAGE_FRAMES_TEMPLATE }
]

export const EXISTING_FRAME_TITLE = 'Existing node frame'

/** A workflow that carries only a group drawn around the existing node. */
export const EXISTING_FRAME_INSERT_OPS: RecordedGraphOperation[] = [
{
op: 'insert_workflow',
workflow: {
nodes: [],
links: [],
groups: [
{
id: 1,
title: EXISTING_FRAME_TITLE,
bounding: [-20, -60, 360, 280],
color: '#3f789e',
font_size: 24,
flags: {}
}
]
}
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import { HostDoc } from '@e2e/fixtures/agentConversationHostDoc'
import { AgentPanel } from '@e2e/fixtures/components/AgentPanel'
import { Topbar } from '@e2e/fixtures/components/Topbar'
import {
EXISTING_FRAME_INSERT_OPS,
EXISTING_FRAME_TITLE,
STAGE_FRAME_TITLES,
STAGE_FRAMES_CATALOG,
STAGE_FRAMES_EXISTING_NODES,
Expand Down Expand Up @@ -195,5 +197,34 @@ test.describe(
)
expect(savedGeometry).toEqual(live.geometry)
})

test('keeps a group drawn around existing nodes on those nodes', async ({
page
}) => {
socket.send(JSON.stringify(host.apply(EXISTING_FRAME_INSERT_OPS)))

await expect
.poll(() =>
page.evaluate(() =>
window.app!.graph.groups.map((group) => {
group.recomputeInsideNodes()
return {
title: group.title,
bounding: [...group._bounding],
members: group.nodes.map((node) =>
String(node.widgets?.[0]?.value ?? '')
)
}
})
)
)
.toEqual([
{
title: EXISTING_FRAME_TITLE,
bounding: [-20, -60, 360, 280],
members: ['Existing node']
}
])
})
}
)
Loading
Loading