Reflète la refonte IDE en supervision légère, sans dupliquer l'éditeur : - statut git fin dans l'arbre (staged/unstaged/conflits + dernier commit) ; - commande « Open Worktree IDE » → deep-link /workspace/:repoId/:wt ; - commandes fetch / pull (ff-only|rebase) sur les worktrees ; - event WS session_archived + réglage showArchivedSessions (badge + filtre). README/CHANGELOG + tests (config/rest-client/ws-client).
23 lines
1.0 KiB
TypeScript
23 lines
1.0 KiB
TypeScript
import { describe, expect, it } from 'vitest';
|
||
import { normalizeBaseUrl, workspaceUrl, wsUrlFromBase } from '../src/config.js';
|
||
|
||
describe('config', () => {
|
||
it('normalise la base URL (slash final, défaut)', () => {
|
||
expect(normalizeBaseUrl('http://127.0.0.1:7317/')).toBe('http://127.0.0.1:7317');
|
||
expect(normalizeBaseUrl(' http://host:8080// ')).toBe('http://host:8080');
|
||
expect(normalizeBaseUrl('')).toBe('http://127.0.0.1:7317');
|
||
});
|
||
|
||
it('dérive l’URL WebSocket (/ws, http→ws, https→wss)', () => {
|
||
expect(wsUrlFromBase('http://127.0.0.1:7317')).toBe('ws://127.0.0.1:7317/ws');
|
||
expect(wsUrlFromBase('https://box.ts.net')).toBe('wss://box.ts.net/ws');
|
||
});
|
||
|
||
it('construit l’URL de la vue IDE web (workspaceUrl, encodage par segment)', () => {
|
||
expect(workspaceUrl('http://127.0.0.1:7317', 'repo id', '/home/user/wt')).toBe(
|
||
'http://127.0.0.1:7317/workspace/repo%20id/%2Fhome%2Fuser%2Fwt',
|
||
);
|
||
expect(workspaceUrl('https://box.ts.net/', 'r', '/a/b')).toBe('https://box.ts.net/workspace/r/%2Fa%2Fb');
|
||
});
|
||
});
|