Skip to content

Segmentation Fault when testing mounted instead of shallowMounted #343

@fornazaric

Description

@fornazaric

Test library: @vue/test-utils v2.3.2
Jest Version: 29.6.2

When testing a component that has an LMap in it and is called using "Mount" it results in a segfault.

I'm wondering if it's caused by one of the Marker, or Circle Marker.

Here's the code used inside my map:

<LMap
            v-model:zoom="zoom"
            v-model:bounds="bounds"
            v-model:center="center"
            :min-zoom="minZoom"
            :max-zoom="maxZoom"
            :use-global-leaflet="false"
            class="z-10"
            :options="{ zoomControl: false }"
            data-testid="map-component"
            @update:center="centerUpdated"
            @update:bounds="boundsUpdated"
            @update:zoom="zoomUpdated"
        >
            <LTileLayer :url="tilesUrl" />
            <LCircleMarker
                v-if="circleMarker.center"
                :lat-lng="circleMarker.center"
                :radius="circleMarker.radius"
                :fill-color="circleMarker.color"
                :fill-opacity="0.8"
                :stroke="false"
            />
            <LMarker
                v-for="marker in markerList"
                v-show="markerList"
                :key="marker.id"
                :lat-lng="marker.latLng"
                @click="markerClicked(marker)"
            >
                <LIcon
                    v-if="!markerIsCluster(marker)"
                    :icon-url="marker.icon"
                    :icon-size="[40, 40]"
                />
                <LIcon v-else>
                    <div class="h-8 w-8">
                        <img :src="marker.icon" class="-m-4 w-8 h-8" />
                        <div class="absolute flex -m-4 w-8 h-8">
                            <span class="m-auto text-white text-base">
                                {{ marker.count }}
                            </span>
                        </div>
                    </div>
                </LIcon>
            </LMarker>
        </LMap>

Might it be because of the SSR ?

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