(hops: WireTrailHop[], over: Partial<WireTrail> = {})
| 45 | } |
| 46 | |
| 47 | function trail(hops: WireTrailHop[], over: Partial<WireTrail> = {}): WireTrail { |
| 48 | const resolved = hops.filter((h) => h.id !== null); |
| 49 | return { |
| 50 | id: 'a-walk', |
| 51 | name: 'A walk', |
| 52 | note: '', |
| 53 | author: 'Ada', |
| 54 | createdAt: '2026-08-01T00:00:00.000Z', |
| 55 | updatedAt: '2026-08-02T00:00:00.000Z', |
| 56 | hops, |
| 57 | resolved: resolved.length, |
| 58 | intact: hops.every((h) => h.status === 'ok'), |
| 59 | encoded: resolved.length > 0 ? resolved.map((h) => `d${h.id}`).join(',') : null, |
| 60 | openFrom: 1, |
| 61 | openCount: resolved.length, |
| 62 | openId: resolved.length > 0 ? (resolved[resolved.length - 1] as WireTrailHop).id : null, |
| 63 | ...over, |
| 64 | }; |
| 65 | } |
| 66 | |
| 67 | describe('trailMeta', () => { |
| 68 | it('reports the SAVED length, whatever became of the hops', () => { |
no test coverage detected