fix(ui): map sensing websocket port for docker (#572)

This commit is contained in:
Rahul
2026-05-18 03:02:13 +05:30
committed by GitHub
parent ea62ec4667
commit 4698f54fa0
3 changed files with 56 additions and 8 deletions
+13 -1
View File
@@ -3,6 +3,7 @@
import { API_CONFIG, buildApiUrl, buildWsUrl } from '../config/api.config.js';
import { apiService } from '../services/api.service.js';
import { wsService } from '../services/websocket.service.js';
import { buildSensingWsUrl } from '../services/sensing.service.js';
import { poseService } from '../services/pose.service.js';
import { healthService } from '../services/health.service.js';
import { TabManager } from '../components/TabManager.js';
@@ -232,6 +233,17 @@ testRunner.test('buildWsUrl constructs WebSocket URLs', 'apiConfig', () => {
testRunner.assert(url.includes('token=test-token'), 'URL should contain token parameter');
});
testRunner.test('buildSensingWsUrl maps Docker UI port to sensing WebSocket port', 'apiConfig', () => {
const url = buildSensingWsUrl({
protocol: 'http:',
host: '192.168.28.147:3000',
hostname: '192.168.28.147',
port: '3000',
});
testRunner.assertEqual(url, 'ws://192.168.28.147:3001/ws/sensing');
});
// API Service Tests
testRunner.test('apiService has required methods', 'apiService', () => {
testRunner.assert(typeof apiService.get === 'function', 'get method should exist');
@@ -473,4 +485,4 @@ document.addEventListener('DOMContentLoaded', () => {
testRunner.updateSummary();
});
export { testRunner };
export { testRunner };