Skip to content

Commit e28998a

Browse files
serpentbladeclaude
andcommitted
test(quick-260610-jrk): assert drag-created edge persists (exact =3)
DOM evidence (instrumented area.addPipe trace) proves the drag-to-connect a→c connection IS created (connectioncreated, programmatic=0) AND renders with a real bezier d that persists — drag-to-connect fully works. The prior "doesn't persist" deferral was a misdiagnosis: Sink's input was a single-connection input (ClassicPreset multiple:false default), so dropping a→c onto c's already-occupied input correctly EVICTED b→c, leaving the count at 2 even though a→c persisted. Give Sink's input multiple:true so a→c ADDS a third edge instead of replacing b→c, then upgrade the post-drag assertion from a soft >=2 to a strict =3 drawn paths (the persistence proof). No FlowCanvas source/emitter change — leaves regenerate byte-identical, dist-parity zero-drift. Passes 6/6 in the container. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 874d784 commit e28998a

2 files changed

Lines changed: 26 additions & 9 deletions

File tree

examples/demos/FlowCanvasDemo.rozie

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,15 @@
4141
nodes: [
4242
{ id: 'a', label: 'Source', x: 20, y: 40, data: { kind: 'in' }, outputs: [{ key: 'out', label: 'out' }] },
4343
{ id: 'b', label: 'Filter', x: 260, y: 40, data: { kind: 'op' }, inputs: [{ key: 'in', label: 'in' }], outputs: [{ key: 'out', label: 'out' }] },
44-
{ id: 'c', label: 'Sink', x: 500, y: 120, data: { kind: 'out' }, inputs: [{ key: 'in', label: 'in' }] },
44+
// Sink's input is `multiple: true` so a drag-created a→c edge ADDS a third
45+
// connection (a→b, b→c, a→c) instead of REPLACING the existing b→c. Rete's
46+
// ClassicPreset single-input (multiple:false, the default) holds exactly one
47+
// connection, so dropping a→c onto an already-occupied single input correctly
48+
// evicts b→c — leaving the edge count at 2 and masking the fact that the new
49+
// a→c edge DID persist. A multiple input lets the drag spec assert the
50+
// drag-created edge persists as an exact 3rd drawn path (the persistence
51+
// proof) rather than a soft ≥2.
52+
{ id: 'c', label: 'Sink', x: 500, y: 120, data: { kind: 'out' }, inputs: [{ key: 'in', label: 'in', multiple: true }] },
4553
],
4654
connections: [
4755
{ id: 'e1', source: 'a', sourceOutput: 'out', target: 'b', targetInput: 'in' },

tests/visual-regression/specs/rete-flow.spec.ts

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -385,15 +385,24 @@ for (const target of TARGETS) {
385385
timeout: 10_000,
386386
});
387387
}
388-
// …and after release the rubber-band preview is torn down, so the drawn-path
389-
// count settles back to the committed config-array edges (a→b, b→c) — the
390-
// transient preview pseudo no longer inflates the count. We assert the committed
391-
// edges persist (≥2) rather than an exact 3: the freshly drag-created a→c edge
392-
// exists in the editor model (the event fired) but the rendering of a connection
393-
// created *during* a drag gesture is a separate Rete connection-view lifecycle
394-
// concern, independent of the preview-line fix under test here.
388+
// PERSISTENCE PROOF (260610-jrk continuation): after release the rubber-band
389+
// pseudo is torn down, but the freshly drag-created a→c edge is a REAL
390+
// connection that renders and PERSISTS with a non-empty `d` — so the drawn-path
391+
// count settles to EXACTLY 3 (a→b, b→c committed + a→c drag-created). This
392+
// upgrades the earlier soft `≥2` (which a vanishing a→c would have passed) to a
393+
// strict `=3` that fails if the drag-created edge does not keep a drawn path.
394+
//
395+
// Why this is now assertable: the DOM evidence in the 260610-jrk continuation
396+
// (an instrumented `area.addPipe` trace) proved the a→c connection IS created
397+
// (`connectioncreated`, programmatic=0) AND rendered with a real bezier `d`. The
398+
// earlier "doesn't persist" reading was a misdiagnosis — Sink's input was a
399+
// single-connection input (ClassicPreset `multiple:false` default), so dropping
400+
// a→c onto c's already-occupied input correctly EVICTED b→c (`connectionremoved`
401+
// for e2), leaving the count at 2 even though a→c persisted. Sink's input is now
402+
// `multiple: true` in FlowCanvasDemo, so a→c ADDS a third edge instead of
403+
// replacing b→c — making the persistence directly countable.
395404
await expect
396405
.poll(drawnCount, { timeout: 10_000, intervals: [100, 300, 600, 1000] })
397-
.toBeGreaterThanOrEqual(2);
406+
.toBe(3);
398407
});
399408
}

0 commit comments

Comments
 (0)