Fix: fix tests

This commit is contained in:
Pieter Vander Vennet 2025-07-25 19:55:08 +02:00
parent 63e9d20255
commit 520e4d8a89

View file

@ -1,7 +1,10 @@
import { FeatureCollection, Point } from "geojson"
import { describe, it } from "vitest"
import StaticFeatureSource from "../../../src/Logic/FeatureSource/Sources/StaticFeatureSource"
import { ClusteringFeatureSource } from "../../../src/Logic/FeatureSource/TiledFeatureSource/ClusteringFeatureSource"
import {
ClusterGrouping,
ClusteringFeatureSource
} from "../../../src/Logic/FeatureSource/TiledFeatureSource/ClusteringFeatureSource"
import { UIEventSource } from "../../../src/Logic/UIEventSource"
import { expect } from "chai"
@ -64,14 +67,14 @@ describe("ClusteringFeatureSource", () => {
cutoff: 2,
dontClusterAboveZoom: 100
})
expect(clusteringSource.summaryPoints.features.data.length).to.eq(0)
const allClusters = ClusterGrouping.singleton.features
expect(allClusters.data.length).to.eq(0)
expect(clusteringSource.features.data.length).to.eq(4)
zoom.set(13)
const summary = clusteringSource.summaryPoints.features.data
expect(summary.length).to.eq(1)
expect(summary[0].properties["total_metric"]).to.eq("4")
expect(allClusters.data.length).to.eq(1)
expect(allClusters.data[0].properties["total_metric"]).to.eq("4")
expect(clusteringSource.features.data.length).to.eq(0)