Skip to content

fix: EmbedGoogleMap passes boolean className to MUI Box #440

Description

@jimmyandrade

Summary

Jest / React PropTypes warn during tests (and potentially in development) when rendering EmbedGoogleMap via LocationStep:

Warning: Failed prop type: Invalid prop `className` of type `boolean` supplied to `Styled(MuiBox)`, expected `string`.
    at StyledComponent (.../@material-ui/styles/styled/styled.js)
    at Iframe (.../muy/dist/index.cjs.js)
    at EmbedGoogleMap (.../muy/dist/index.cjs.js)
    at EmbedGoogleMap (src/containers/EmbedGoogleMap/index.js)
    at LocationStep (src/components/LocationStep/index.js)

Root cause

muy@1.1.0 Iframe sets:

className: variant === "cover" && classes.cover

When variant is not "cover", that expression is false, which Material-UI Box rejects.

Acceptance criteria

  • No PropTypes warning about boolean className when rendering EmbedGoogleMap without variant="cover"
  • Cover variant still applies cover styling when needed (ParkingExpansionPanel)
  • Production code changes are covered by unit tests
  • Existing LocationStep / EmbedGoogleMap tests stay green

Notes

Prefer fixing in src/containers/EmbedGoogleMap (local implementation or safe wrapper) rather than patching node_modules/muy.

Resolution

Fixed on branch fix/embed-google-map-classname-boolean by implementing EmbedGoogleMap locally with string-safe className resolution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions