const assert=require('node:assert/strict'); const H=require('../app/static/editor-helpers.js'); const layout={id:'layout_0001',type:'layout',columns:[{width:1,blocks:[{id:'child_0001',type:'cta',title:'A'},{id:'child_0002',type:'cta',title:'B'}]},{width:1,blocks:[]}]}; const rows=[layout];const spec={cta:{fields:['title','subtitle','href']}}; assert.equal(H.findNestedChild(rows,'layout_0001','child_0002').child.title,'B'); assert.equal(H.findNestedChild(rows,'layout_0001','unknown'),null); assert.equal(H.findNestedChild(rows,'unknown','child_0001'),null); assert.equal(H.safeNestedCanvasCommand({action:'child-select',blockId:'layout_0001',childId:'child_0001'},rows,spec),true); assert.equal(H.safeNestedCanvasCommand({action:'child-inline-text',blockId:'layout_0001',childId:'child_0001',field:'title',value:'New'},rows,spec),true); assert.equal(H.safeNestedCanvasCommand({action:'child-inline-text',blockId:'layout_0001',childId:'child_0001',field:'body',value:'