mirror of
https://github.com/ruvnet/RuView
synced 2026-08-04 19:31:42 +00:00
fix: implement 14 missing API endpoints, fix WebSocket connectivity, and replace 25 placeholder mobile tests
The web UI had persistent 404 errors on model, recording, and training endpoints, and the sensing WebSocket never connected on Dashboard/Live Demo tabs because sensingService.start() was only called lazily on Sensing tab visit. Server (main.rs): - Add 14 fully-functional Axum handlers: model CRUD (7), recording lifecycle (4), training control (3) - Scan data/models/ and data/recordings/ at startup - Recording writes CSI frames to .jsonl via tokio background task - Model load/unload lifecycle with state tracking Web UI (app.js): - Import and start sensingService early in initializeServices() so Dashboard and Live Demo tabs connect to /ws/sensing immediately Mobile (ws.service.ts): - Fix WebSocket URL builder to use same-origin port instead of hardcoded port 3001 Mobile (jest.config.js): - Fix testPathIgnorePatterns that was ignoring the entire test directory Mobile (25 test files): - Replace all it.todo() placeholder tests with real implementations covering components, services, stores, hooks, screens, and utils ADR-043 documents all changes. Co-Authored-By: claude-flow <ruv@ruv.net>
This commit is contained in:
@@ -1,5 +1,36 @@
|
||||
describe('placeholder', () => {
|
||||
it('passes', () => {
|
||||
expect(true).toBe(true);
|
||||
import React from 'react';
|
||||
import { render, screen } from '@testing-library/react-native';
|
||||
import { ConnectionBanner } from '@/components/ConnectionBanner';
|
||||
import { ThemeProvider } from '@/theme/ThemeContext';
|
||||
|
||||
const renderWithTheme = (ui: React.ReactElement) =>
|
||||
render(<ThemeProvider>{ui}</ThemeProvider>);
|
||||
|
||||
describe('ConnectionBanner', () => {
|
||||
it('renders LIVE STREAM text when connected', () => {
|
||||
renderWithTheme(<ConnectionBanner status="connected" />);
|
||||
expect(screen.getByText('LIVE STREAM')).toBeTruthy();
|
||||
});
|
||||
|
||||
it('renders DISCONNECTED text when disconnected', () => {
|
||||
renderWithTheme(<ConnectionBanner status="disconnected" />);
|
||||
expect(screen.getByText('DISCONNECTED')).toBeTruthy();
|
||||
});
|
||||
|
||||
it('renders SIMULATED DATA text when simulated', () => {
|
||||
renderWithTheme(<ConnectionBanner status="simulated" />);
|
||||
expect(screen.getByText('SIMULATED DATA')).toBeTruthy();
|
||||
});
|
||||
|
||||
it('renders without crashing for each status', () => {
|
||||
const statuses: Array<'connected' | 'simulated' | 'disconnected'> = [
|
||||
'connected',
|
||||
'simulated',
|
||||
'disconnected',
|
||||
];
|
||||
for (const status of statuses) {
|
||||
const { unmount } = renderWithTheme(<ConnectionBanner status={status} />);
|
||||
unmount();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user