Skip to content

fix(frontend): await the render in the LeafletLayers tests - #610

Merged
JuliusHenke merged 1 commit into
masterfrom
fix/frontend-await-leaflet-layers-render
Oct 12, 2026
Merged

JuliusHenke merged 1 commit into
masterfrom
fix/frontend-await-leaflet-layers-render

Conversation

@JuliusHenke

Copy link
Copy Markdown
Member

What

renderLayers in LeafletLayers.test.tsx called renderWithProviders(...) without awaiting it and returned {screen, reloadSelectedDay}. await renderLayers(...) therefore awaited a plain object and never waited for the render. When a CI runner was slow, the render could finish after the test (or the cleanup) had moved on and fail as an unhandled rejection, which fails the whole run:

Unhandled Rejection
TypeError: Cannot read properties of undefined (reading 'includes')
 ❯ Object.render ... vitest-browser-react
The last test to run before this error was "selects a family directly when it is alone at its location"

Seen in the "Frontend Push" run of #609 (a firebase.json-only change), while "Frontend Pull Request" passed for the very same commit.

Fix

renderLayers is now async and awaits the render. No production code changes.

Verification

tsc, eslint and yarn test:coverage (3 runs, 244 tests, no errors). I could not reproduce the failure locally before the change either (4 runs), as it depends on runner speed, so this is the most likely cause rather than a reproduced one. If the error shows up again after this, the next suspect is the lazy dialogs finishing after cleanup.

Dependencies / deployment

None.

🤖 Generated with Claude Code

renderLayers returned an object holding the render promise, so await renderLayers() never waited for the render. On a slow runner the render could finish after the test was over and fail as an unhandled rejection (TypeError reading 'includes' in render, seen in CI on an unrelated PR).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@JuliusHenke JuliusHenke added bug Something isn't working frontend labels Oct 12, 2026
@github-actions

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit 5c618ea):

https://tormap-36f44--pr610-fix-frontend-await-l-w10rlgek.web.app

(expires Wed, 11 Nov 2026 17:39:08 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 0c1f71965de18e60b0e686b0d0356977fec090dc

@JuliusHenke
JuliusHenke marked this pull request as ready for review October 12, 2026 17:51
@JuliusHenke
JuliusHenke merged commit 198c26c into master Oct 12, 2026
15 checks passed
@JuliusHenke
JuliusHenke deleted the fix/frontend-await-leaflet-layers-render branch October 12, 2026 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant