fix(abacus-react): add data-testid attributes back to beads for testing
After the refactor to shared SVG rendering, data-testid attributes were
removed from beads, causing controlled-input tests to fail. Added them
back to both AbacusAnimatedBead and AbacusStaticBead for test compatibility.
Test IDs follow pattern: bead-place-{placeValue}-{type}[-pos-{position}]
Examples: bead-place-0-heaven, bead-place-0-earth-pos-0
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -293,6 +293,7 @@ export function AbacusAnimatedBead({
|
||||
<>
|
||||
<GElement
|
||||
className={`abacus-bead ${bead.active ? 'active' : 'inactive'} ${hideInactiveBeads && !bead.active ? 'hidden-inactive' : ''}`}
|
||||
data-testid={`bead-place-${bead.placeValue}-${bead.type}${bead.type === 'earth' ? `-pos-${bead.position}` : ''}`}
|
||||
style={beadStyle}
|
||||
{...bind()}
|
||||
onClick={handleClick}
|
||||
|
||||
@@ -91,6 +91,7 @@ export function AbacusStaticBead({
|
||||
return (
|
||||
<g
|
||||
className={`abacus-bead ${bead.active ? 'active' : 'inactive'} ${hideInactiveBeads && !bead.active ? 'hidden-inactive' : ''}`}
|
||||
data-testid={`bead-place-${bead.placeValue}-${bead.type}${bead.type === 'earth' ? `-pos-${bead.position}` : ''}`}
|
||||
transform={transform}
|
||||
style={{ transition: 'opacity 0.2s ease-in-out' }}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user