mirror of
https://github.com/BigBodyCobain/Shadowbroker.git
synced 2026-07-25 21:20:55 +02:00
test: add JSDF bases tests (RED phase)
- Add gsdf/msdf/asdf to known_branches in test_branch_values_are_known - Add test_includes_jsdf_bases for Yonaguni, Naha, Kure - Add test_colocated_bases_have_separate_entries for Misawa - Add buildMilitaryBasesGeoJSON tests with ASDF branch validation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2,9 +2,34 @@ import { describe, it, expect } from 'vitest';
|
||||
import {
|
||||
buildEarthquakesGeoJSON, buildJammingGeoJSON, buildCctvGeoJSON, buildKiwisdrGeoJSON,
|
||||
buildFirmsGeoJSON, buildInternetOutagesGeoJSON, buildDataCentersGeoJSON,
|
||||
buildGdeltGeoJSON, buildLiveuaGeoJSON, buildFrontlineGeoJSON
|
||||
buildGdeltGeoJSON, buildLiveuaGeoJSON, buildFrontlineGeoJSON, buildMilitaryBasesGeoJSON
|
||||
} from '@/components/map/geoJSONBuilders';
|
||||
import type { Earthquake, GPSJammingZone, FireHotspot, InternetOutage, DataCenter, GDELTIncident, LiveUAmapIncident, CCTVCamera, KiwiSDR } from '@/types/dashboard';
|
||||
import type { Earthquake, GPSJammingZone, FireHotspot, InternetOutage, DataCenter, GDELTIncident, LiveUAmapIncident, CCTVCamera, KiwiSDR, MilitaryBase } from '@/types/dashboard';
|
||||
|
||||
// ─── Military Bases ────────────────────────────────────────────────────────
|
||||
|
||||
describe('buildMilitaryBasesGeoJSON', () => {
|
||||
it('returns null for empty/undefined input', () => {
|
||||
expect(buildMilitaryBasesGeoJSON(undefined)).toBeNull();
|
||||
expect(buildMilitaryBasesGeoJSON([])).toBeNull();
|
||||
});
|
||||
|
||||
it('builds valid Feature for ASDF branch base', () => {
|
||||
const bases: MilitaryBase[] = [
|
||||
{ name: 'Naha Air Base', country: 'Japan', operator: 'ASDF 9th Air Wing', branch: 'asdf', lat: 26.196, lng: 127.646 },
|
||||
];
|
||||
const result = buildMilitaryBasesGeoJSON(bases);
|
||||
expect(result).not.toBeNull();
|
||||
expect(result!.type).toBe('FeatureCollection');
|
||||
expect(result!.features).toHaveLength(1);
|
||||
|
||||
const f = result!.features[0];
|
||||
expect(f.geometry).toEqual({ type: 'Point', coordinates: [127.646, 26.196] });
|
||||
expect(f.properties?.type).toBe('military_base');
|
||||
expect(f.properties?.branch).toBe('asdf');
|
||||
expect(f.properties?.name).toBe('Naha Air Base');
|
||||
});
|
||||
});
|
||||
|
||||
// ─── Earthquakes ────────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
Reference in New Issue
Block a user