open-formulieren / open-forms-sdk

A Javascript SDK for Open Forms
https://open-forms.readthedocs.io/en/stable/developers/sdk/index.html
Other
2 stars 6 forks source link

[open-formulieren/open-forms#4201] Fix crash with hidden map component #674

Closed Viicos closed 3 months ago

Viicos commented 4 months ago

Fixes open-formulieren/open-forms#4201

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 55.53%. Comparing base (8f502bb) to head (887fe91). Report is 4 commits behind head on main.

Files Patch % Lines
src/formio/components/Map.js 0.00% 2 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #674 +/- ## ========================================== - Coverage 61.24% 55.53% -5.72% ========================================== Files 225 221 -4 Lines 4126 3967 -159 Branches 849 722 -127 ========================================== - Hits 2527 2203 -324 - Misses 1480 1561 +81 - Partials 119 203 +84 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

sergei-maertens commented 3 months ago

I don't understand how this test replicates the crash? The issue specifies that the crash does not occur when adding frontend logic, so it doesn't seem logical to me to add a story of a map component with frontend logic.

Adding FE logic to the map component solves the issue. back-end logic does not.

Can't we just write a simple jest regression test (not a story) here for a map component that's hidden and then validate the fix against that?

Viicos commented 3 months ago

Can't we just write a simple jest regression test (not a story) here for a map component that's hidden and then validate the fix against that?

Hum I think what I did first was to define the story without any play defined, or at least a play without any body, but from what I remember, while it did crash without my fix, it still passed the story test. This is why I used the conditional logic to have a meaningful story test. However, testing now even with an empty play body seems to be caught by SB. Anyway, this is confusing and I can't remember exactly what I did previously