diff --git a/src/components/swarm/swarm-mission-picker.tsx b/src/components/swarm/swarm-mission-picker.tsx new file mode 100644 index 0000000..ae23491 --- /dev/null +++ b/src/components/swarm/swarm-mission-picker.tsx @@ -0,0 +1,34 @@ +"use client"; + +import React from 'react'; +import { useUrlState } from '@/hooks/use-url-state'; + +// Mock hook for now, would connect to actual beads data +const useMissionList = () => ({ + missions: [ + { id: '1', title: 'Sample Mission', progress: 50 } + ] +}); + +export function SwarmMissionPicker() { + const { setUrlState, swarmId } = useUrlState(); + const { missions } = useMissionList(); + + return ( +
+

Active Missions

+ {missions.map(m => ( + + ))} +
+ ); +} diff --git a/tests/components/swarm/swarm-mission-picker.test.tsx b/tests/components/swarm/swarm-mission-picker.test.tsx new file mode 100644 index 0000000..cae41ea --- /dev/null +++ b/tests/components/swarm/swarm-mission-picker.test.tsx @@ -0,0 +1,14 @@ +import { expect, test, describe, mock } from 'bun:test'; + +// Mock the hook that the component tries to import +mock.module('@/hooks/use-url-state', () => ({ + useUrlState: () => ({ setUrlState: () => { }, swarmId: '1' }) +})); + +describe('SwarmMissionPicker Component', () => { + test('exports SwarmMissionPicker component that is a function', async () => { + const mod = await import('../../../src/components/swarm/swarm-mission-picker'); + expect(mod.SwarmMissionPicker).toBeDefined(); + expect(typeof mod.SwarmMissionPicker).toBe('function'); + }); +});