@@ -203,6 +203,38 @@ def test_worker_settling_resistance_keeps_high_end_distinct() -> None:
203203 assert samples ["14" ] != samples ["15" ]
204204
205205
206+ def test_worker_honors_zero_link_spring_stiffness () -> None :
207+ """A zero Link spring value must remove pair attraction, not leave a residual floor."""
208+ script = """
209+ const nodes = [
210+ { id: 'a', community_id: 'c' },
211+ { id: 'b', community_id: 'c' },
212+ ];
213+ send({ type: 'prepare', payload: { nodes, links: [{ source: 'a', target: 'b' }] } });
214+ const waitForFit = (start, callback) => {
215+ const tick = () => {
216+ const fit = messages.slice(start).find(item => item.type === 'layout' && item.fit === true);
217+ if (fit) return callback(fit.positions);
218+ setTimeout(tick, 10);
219+ };
220+ tick();
221+ };
222+ setTimeout(() => {
223+ const seeded = latest('preview').positions.slice();
224+ const start = messages.length;
225+ send({ type: 'settings', settings: {
226+ repel: 0, gravity: 0, springStiffness: 0, damping: 1,
227+ }, relayout: true, fit: true });
228+ waitForFit(start, positions => {
229+ const delta = Math.max(...positions.map((value, index) => Math.abs(value - seeded[index])));
230+ console.log(JSON.stringify({ delta }));
231+ });
232+ }, 50);
233+ """
234+ report = _run_worker (script )
235+ assert report ["delta" ] == 0
236+
237+
206238def test_renderer_is_webgl2_only_without_live_simulation_or_canvas_fallback () -> None :
207239 renderer = RENDERER .read_text (encoding = "utf-8" )
208240 assert "getContext('webgl2'" in renderer
0 commit comments