Commit 16f15d3
Establish React component testing patterns for geoset-map-chart (#345)
* #310 establish React component testing patterns for geoset-map-chart plugin
Add comprehensive test suite covering utility functions, components, and hooks:
- MultiLegend component tests with theme provider wrapper
- colors.ts: computeSizeScale, toRGBA, rgbaArrayToHex, applyColorMapping,
computeMetricColorScaleUnified, getFeatureColor, percentile helpers, lerp functions
- colorsFallback.ts: hasValidFill, normalizeRGBA, normalizeColorToHex,
rgbaArrayToCssString, rgbaObjectToArray
- dataProcessing.ts: getBreakPoints, parseRawFeatures, normalizeNullCategory,
getGeometryType
- fitViewport.ts: isValidViewport, toNumericViewport, fitViewport,
calculateAutozoomViewport
- convertToGeoJson.ts: convertToGeoJSONFeature (GeoJSON, WKT, edge cases)
- computeBoundsFromPoints.ts: bounds computation and expansion
- hooks.ts and legendHelpers.ts: full coverage
- Extract legendHelpers utility from MultiLegend for testability
- Add shared test fixtures and theme-wrapped render helper
11 test suites, 218 tests, src/utils coverage raised from 14.7% to 49.2%
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* #310 expand test coverage for geoset-map-chart utility modules
Add new test suites and expand existing ones:
- validateLayerType: full coverage of geometry type mapping
- measureDistance: Haversine formula and imperial formatting
- safeStringify: circular reference handling and prettyStringify
- liveViewportStore: set/get round-trip
- formatNumber: legend number formatting with K/M/B suffixes
- colors.ts: cssToRgbaArray, normalizeColorInput, addColor,
normalizeCategoryColorMapping object branch, breakpoint edge cases
- dataProcessing.ts: getBreakPointColorScaler and getBuckets
Coverage raised from 43% to 57% statements for src/utils/
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Merge conflict fix
* fix: deduplicate formatLegendNumber test cases after merge conflict
* #310 add Legend component tests and fix TS errors in test files
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* #310 expand GeoSetLayer tests with getLayer and getLayerStates coverage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: address PR #339 review feedback on test quality
- Extract duplicated svgIcons jest.mock blocks into shared test/mocks/svgIcons.ts
- Restore deck.gl rendering-order comments in sorting tests
- Remove unfailable and trivial tests (liveViewportStore, safeStringify)
- Consolidate normalizeNullCategory tests with it.each
- Fix brittle computeSizeScale midpoint assertion
- Add edge-case tests: getDefaultColors undefined props, applyCategoryEnabledState
falsy values, MULTI WKT geometries, unrecognized geoJsonLayer, invalid Legend position
- Add explanatory comment for cssToRgbaArray canvas mocking
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: cast invalid position string to any for TS compatibility
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: lhawkins <lhawkins@teamraft.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Ethan Bienstock <ethan.bienstock@acf.hhs.gov>1 parent 8b8a70b commit 16f15d3
25 files changed
Lines changed: 4508 additions & 86 deletions
File tree
- superset-frontend
- plugins/geoset-map-chart
- src
- GeoSetMultiMap
- components
- utils
- test
- components
- layers
- mocks
- utils
- example-json
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
Lines changed: 1 addition & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
| 57 | + | |
66 | 58 | | |
67 | 59 | | |
68 | 60 | | |
| |||
Lines changed: 1 addition & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
206 | 207 | | |
207 | 208 | | |
208 | 209 | | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | 210 | | |
231 | 211 | | |
232 | 212 | | |
| |||
Lines changed: 34 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
0 commit comments