Skip to content

test(webapp): wait for a navigation before asking which one the viewport draws - #364

Merged
InstaZDLL merged 1 commit into
mainfrom
test/mobile-navigation-wait
Oct 27, 2026
Merged

InstaZDLL merged 1 commit into
mainfrom
test/mobile-navigation-wait

Conversation

@InstaZDLL

@InstaZDLL InstaZDLL commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

After the five webapp restructuring PRs (#359–#363) merged, I ran the full suite on main. Everything passes except one Playwright test, library-cache.spec.ts › "takes the current tab back to its plain address" (mobile). It timed out on a click once in that run, and passed 16/16 when run alone.

Cause

The test chooses its navigation with isVisible(), which answers immediately and never waits. The run's call log shows what went wrong on the phone:

  1. When the test asked, the shell was still mounting, and neither navigation was on screen yet.
  2. isVisible() therefore reported no phone navigation.
  3. The test then waited for the "Now playing" link in the sidebar, which a phone never draws, until the timeout.

The same pattern appears in five library-cache tests and in both copies of navigateWithin, in fixtures/radio.ts and smart-playlists-and-podcasts.spec.ts. Those two copies test .sidebar the same way, so they could fail the opposite way: a desktop whose sidebar wasn't drawn yet would be treated as a phone.

Fix

A new e2e/fixtures/navigation.ts exports onPhoneNavigation(page). It waits for whichever navigation the viewport draws (.mobile-navigation:visible, .primary-navigation:visible), then asks whether it is the phone's. All seven call sites use it. Each test's logic is otherwise unchanged.

Checks

  • Specs that use the helpers (library-cache, radio, smart-playlists-and-podcasts): 60 passed, 6 skipped.
  • Biome: clean on e2e/.
  • Rest of main, before this change:
    • Playwright: 476 passed, 31 skipped; the 1 failure was the test fixed here.
    • vitest: 327 tests.
    • Typecheck and build pass.
    • Rust: fmt, the layout gate, clippy, cargo doc -D warnings and 666 tests all pass.

No inversion: the race only shows under load and could not be reproduced on demand. The reasoning above rests on the run's call log.

Summary by CodeRabbit

  • Tests
    • Les scénarios automatisés vérifient plus uniformément la navigation sur téléphone, notamment lors du chargement et du changement d’onglet.
    • Les tests tiennent compte de la navigation mobile ou principale visible pour choisir le parcours à valider.

…ort draws

Five library-cache tests and both navigateWithin helpers chose between the phone's bottom bar and the sidebar with isVisible(), which answers at once. Asked while the shell was still mounting, it saw neither: on a phone the tests then looked for their links in the sidebar until they timed out, which is how 'takes the current tab back to its plain address' failed once in a full run on merged main (16/16 alone). onPhoneNavigation waits for whichever navigation is drawn, then asks.

Signed-off-by: InstaZDLL <github.105mh@8shield.net>
@github-actions github-actions Bot added type: test Tests scope: web Embedded web player (React) size: s 10-50 lines and removed type: test Tests labels Oct 27, 2026
@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 575e3b8 and 28307ee.

Files selected for processing: 4
  • webapp/e2e/fixtures/navigation.ts
  • webapp/e2e/fixtures/radio.ts
  • webapp/e2e/library-cache.spec.ts
  • webapp/e2e/smart-playlists-and-podcasts.spec.ts

Limit details: You’ve used the included review currently available. Your 85 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Walkthrough

Les tests E2E disposent d’un helper qui attend l’affichage d’une navigation mobile ou principale. Les parcours de navigation dans les fixtures et les tests utilisent ce helper pour déterminer si la page suit le parcours mobile.

Changes: Détection de la navigation mobile

Layer / File(s) Summary
Helper de détection de la navigation
webapp/e2e/fixtures/navigation.ts
onPhoneNavigation(page) attend l’affichage de .mobile-navigation ou .primary-navigation, puis renvoie si .mobile-navigation est visible.
Mise à jour des parcours E2E
webapp/e2e/fixtures/radio.ts, webapp/e2e/library-cache.spec.ts, webapp/e2e/smart-playlists-and-podcasts.spec.ts
Les parcours remplacent le contrôle direct de la barre mobile ou latérale par onPhoneNavigation(page) pour choisir la navigation mobile ou principale.

Priority: Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

  • InstaZDLL/waveflow-server#363 extrait navigateWithin vers une fixture et sépare les tests concernés. Cette PR met à jour ces mêmes helpers et tests pour attendre une navigation visible.

Suggested labels: scope: web

Merge Risk: Minimal · up to 28307

No actionable merge-blocking risk was identified.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed Le titre décrit clairement le changement principal : attendre qu’une navigation soit rendue avant de déterminer celle utilisée par le viewport.
Description check Passed La description explique le problème, sa cause, la correction et les résultats des validations. Elle ne reprend pas les rubriques exactes du modèle ni les cases du plan de test, mais les informations e…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 4 files.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

La description explique le problème, sa cause, la correction et les résultats des validations. Elle ne reprend pas les rubriques exactes du modèle ni les cases du plan de test, mais les informations essentielles sont présentes.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

Biome (2.5.15)
webapp/e2e/fixtures/navigation.ts

Biome could not lint this file: nested root configuration. Check the repository's Biome configuration and plugins.

webapp/e2e/fixtures/radio.ts

Biome could not lint this file: nested root configuration. Check the repository's Biome configuration and plugins.

webapp/e2e/library-cache.spec.ts

Biome could not lint this file: nested root configuration. Check the repository's Biome configuration and plugins.

  • 1 others

Usage-based review receipt

Note

This review was completed with usage-based billing: files reviewed beyond your plan's included limits are billed at $0.25/file. View usage-based billing.

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the type: test Tests label Oct 27, 2026
@InstaZDLL InstaZDLL self-assigned this Oct 27, 2026
@InstaZDLL
InstaZDLL merged commit 764de7a into main Oct 27, 2026
15 of 16 checks passed
@InstaZDLL
InstaZDLL deleted the test/mobile-navigation-wait branch October 27, 2026 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: web Embedded web player (React) size: s 10-50 lines type: test Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant