(nodes: SnapshotNode[])
| 273 | } |
| 274 | |
| 275 | function buildScrollStateSignature(nodes: SnapshotNode[]): string { |
| 276 | return nodes |
| 277 | .map((node) => { |
| 278 | const rectSignature = node.rect |
| 279 | ? ['x', 'y', 'width', 'height'] |
| 280 | .map((key) => |
| 281 | roundSignatureNumber(node.rect?.[key as keyof NonNullable<SnapshotNode['rect']>]), |
| 282 | ) |
| 283 | .join(',') |
| 284 | : ''; |
| 285 | return [ |
| 286 | String(node.index ?? ''), |
| 287 | String(node.parentIndex ?? ''), |
| 288 | String(node.type ?? ''), |
| 289 | String(node.label ?? ''), |
| 290 | String(node.value ?? ''), |
| 291 | rectSignature, |
| 292 | ].join('|'); |
| 293 | }) |
| 294 | .join('\n'); |
| 295 | } |
| 296 | |
| 297 | function compareSpecificScrollContainer(a: SnapshotNode, b: SnapshotNode): number { |
| 298 | return rectArea(a.rect) - rectArea(b.rect); |
no test coverage detected
searching dependent graphs…