docs: ajouter section tests dans CLAUDE.md
This commit is contained in:
26
CLAUDE.md
26
CLAUDE.md
@@ -3,17 +3,18 @@
|
||||
Application desktop de télésecrétariat pour les postes RDVPREM.
|
||||
|
||||
## Stack
|
||||
- **Electron 28** + **SignalR** (@microsoft/signalr 9.0.6) + **Choices.js** 11.1.0
|
||||
- **Electron 28** + **Socket.IO** (socket.io-client 4.8.1) + **Choices.js** 11.1.0
|
||||
- HTML/CSS/JavaScript natif (pas de framework frontend)
|
||||
|
||||
## Structure
|
||||
|
||||
```
|
||||
├── main.js # Process principal — SignalR, IPC, fenêtres
|
||||
├── main.js # Process principal — Socket.IO, IPC, fenêtres
|
||||
├── socketio-adapter.js # Adaptateur Socket.IO (connect/logoff/disconnect)
|
||||
├── renderer.js # Process renderer — UI, webviews
|
||||
├── index.html # Structure HTML
|
||||
├── styles-modern.css # Styles CSS
|
||||
├── config.json # Config SignalR (host, port, serviceProvider)
|
||||
├── config.json # Config Socket.IO (serverUrl, serviceProvider)
|
||||
└── notes/ # Stockage notes agents (notes_{agentId}.json)
|
||||
```
|
||||
|
||||
@@ -27,15 +28,24 @@ bun run build:linux # Build Linux (AppImage, .deb, .rpm)
|
||||
bun run build:mac # Build macOS (.dmg, .app)
|
||||
```
|
||||
|
||||
## Tests
|
||||
|
||||
```bash
|
||||
bun test # 8 tests unitaires socketio-adapter
|
||||
```
|
||||
|
||||
- `socketio-adapter.js` accepte un socket factory en 2e param (injection pour tests)
|
||||
- Fake socket avec EventEmitter minimal dans `socketio-adapter.test.js`
|
||||
|
||||
## Points d'attention
|
||||
|
||||
- **Pas d'emojis** dans l'UI — icônes SVG inline (compatibilité Linux)
|
||||
- **Sessions webview isolées** : partition Electron unique par centre, auto-connexion via preload script
|
||||
- **SignalR reconnexion** : [0, 2000, 5000, 10000]ms
|
||||
- **IPC principal** : `agent-login`, `get-terminals`, `signalr-status`, `switch-to-center`, `release-center`
|
||||
- **Hub SignalR** : `/planningHub` — méthodes `AgentLogin`, `AgentLogoff`, `GetTerminalListByServiceProvider`
|
||||
- **Événement `IpbxEvent`** : codes 1=appel entrant, 2=fin d'appel
|
||||
- **Logs SignalR** : `~/.simpleconnect-ng/signalr.log` (JSON structuré)
|
||||
- **Socket.IO reconnexion** : illimitée (2s→10s backoff)
|
||||
- **IPC principal** : `login-agent`, `get-terminal-list`, `server-status`, `switch-to-center`, `release-center`
|
||||
- **Protocole serveur** : auth au handshake, events `login_ok`/`login_error`/`ipbx_event`/`logout`→`logout_ok`
|
||||
- **Terminaux** : REST `GET /terminals?provider=RDVPREM` (pas Socket.IO)
|
||||
- **Logs** : `~/.simpleconnect-ng/socketio.log`
|
||||
- **Notes** : sauvegarde auto après 2s d'inactivité, 50 versions, sync localStorage + fichier
|
||||
|
||||
## Workflow de développement
|
||||
|
||||
Reference in New Issue
Block a user