getByTestId('swap-buy-button').waitFor({ state: 'visible' }) resolved
immediately because the button is always rendered; only its text changes.
Replace with expect(...).toHaveText('Buy KRK', { timeout: 60_000 }) to
correctly gate on the button returning to its idle state.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- 01-acquire-and-stake: replace flat 3 s wait with a 30 s polling loop so
Ponder indexing lag no longer causes a spurious positions.length=0 failure.
- 05-optimizer-integration test 1: replace hard-coded OptimizerV3 bear-market
constants (anchorShare=3e17, anchorWidth=100, discoveryDepth=3e17) with
Optimizer.sol invariant checks:
capitalInefficiency + anchorShare == 1e18
discoveryDepth == anchorShare
anchorWidth ∈ [10, 80]
- 05-optimizer-integration test 2: decouple bootstrap-position assertion from
current optimizer state. Earlier tests change staking state, so the current
optimizer anchorWidth differs from the one used at bootstrap time. Instead,
reverse-calculate the implied anchorWidth from the observed anchor spread and
verify it lies within [10, 80].
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements window.__testHelpers.fillStakeForm() to enable stable E2E testing
of the staking form without fragile UI selectors.
## Changes
- Add window.__testHelpers interface (dev mode only)
- Implement fillStakeForm() in StakeHolder.vue with input validation
- Add TypeScript declarations in env.d.ts
- Update E2E test to use helper and verify full user journey
- Create INTEGRATION_TEST_STATUS.md documenting test coverage
- Document helper in web-app/README.md
## Test Coverage
Playwright E2E now validates complete flow:
- Mint ETH via cheats page UI
- Swap KRK via cheats page UI
- Stake KRK via stake page UI (helper + click)
- Verify position via GraphQL
Both Playwright and verify-swap.sh tests now work independently.
resolves#62
Co-authored-by: johba <johba@harb.eth>
Reviewed-on: https://codeberg.org/johba/harb/pulls/66