Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation Fault when testing mounted instead of shallowMounted #343

Open
fornazaric opened this issue Aug 21, 2023 · 0 comments
Open

Comments

@fornazaric
Copy link

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant