Skip to content

Update burndown e2e tests and mocks for feature flag handling#150

Merged
aymenfurter merged 1 commit into
mainfrom
109-fix-burndown-e2e-tests-broken
Jun 20, 2026
Merged

Update burndown e2e tests and mocks for feature flag handling#150
aymenfurter merged 1 commit into
mainfrom
109-fix-burndown-e2e-tests-broken

Conversation

@TamasBoncz

@TamasBoncz TamasBoncz commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes #109. The burndown e2e tests were failing because FF_TOKEN_REPORTING_ENABLED is off, so app.ts removes the [data-page="burndown"] nav link at runtime. The tests still tried to click that (now-missing) link, timing out for 30s × 5 tests in beforeEach.

Since burndown won't be re-enabled in the near future, this PR makes the tests skip gracefully instead of failing, and adds TODO notes so the stale assertions and incomplete mock get fixed when the flag is flipped back on.

Changes

  • tests/e2e/burndown.spec.ts
    • Split the navigateToBurndown helper into bootHarness (load + wait for render) and the nav-click step.
    • In beforeEach, after the harness boots, check whether [data-page="burndown"] still exists. The flag-gating removal runs synchronously on app.js load, so the link is already gone by boot time → test.skip(...) fires before any click, avoiding the timeout.
    • Added a TODO(FF_TOKEN_REPORTING_ENABLED) block documenting the stale value assertions (old getBurndown 1500 / 248 / 2480 vs new getAiCreditBurndown 300 / 42.5 / 425).
  • tests/e2e/harness.html — Added a TODO(FF_TOKEN_REPORTING_ENABLED) note on the getAiCreditBurndown mock listing the missing fields (byModel, missingPct, countedRequests, partialRequests, pendingRequests, noDataRequests, finalizableRequests, delegatedRequests, coverageByDay, daysUntilExhaustion, safeDailyBudget, projectedOverage, totalRequests) that block the status section from rendering; points to the real shape in src/core/analyzer-consumption.ts.
  • src/core/constants.ts — Added a comment at the FF_TOKEN_REPORTING_ENABLED definition reminding whoever re-enables it to update the two test files above.

All three notes share the searchable tag TODO(FF_TOKEN_REPORTING_ENABLED) — a single grep surfaces every spot to fix.

Testing

npx playwright test tests/e2e/burndown.spec.ts

Before:

Running 5 tests using 1 worker
  5 failed   (locator.click: Test timeout of 30000ms exceeded — waiting for locator('[data-page="burndown"]'))

After:

Running 5 tests using 1 worker
  5 skipped

Exits 0.

@github-actions

Copy link
Copy Markdown

⚠️ Deprecation Warning: The deny-licenses option is deprecated for possible removal in the next major release. For more information, see issue 997.

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@aymenfurter aymenfurter merged commit b06610b into main Jun 20, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: burndown e2e tests broken — stale assertions + missing feature-flag skip

2 participants