- Panel zeigt bei 503/G10 und 403/G07 einen Hinweis statt sich auszublenden; ohne Login unsichtbar - Startlog: Info-Zeile bei aktivem Backend (kid, Allowlist), ohne Secrets - docs/git: Abschnitt Fehlersuche / nachträglich aktivieren - docs/deploy: compose.yaml-Vorlage für das veröffentlichte Image, Verlinkung aus README/FORK/auth/storage - Dev-Compose reicht HB_ASSET_* durch Refs #30 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
21 lines
1.1 KiB
JavaScript
21 lines
1.1 KiB
JavaScript
import { classifyListError, NOTICES } from '../../client/fork/git/panelState.js';
|
|
|
|
describe('Git-Panel: Zustand aus dem Listen-Fehler (FLW-258)', ()=>{
|
|
test('503 G10: Hinweis „nicht aktiviert“ mit Verweis auf docs/git', ()=>{
|
|
const r = classifyListError({ status: 503, HBErrorCode: 'G10' });
|
|
expect(r).toEqual({ state: 'notice', notice: NOTICES.disabled });
|
|
expect(r.notice).toMatch(/nicht aktiviert.*docs\/git/);
|
|
});
|
|
test('403 G07: Hinweis „Nur mit OIDC-Anmeldung verfügbar“', ()=>{
|
|
expect(classifyListError({ status: 403, HBErrorCode: 'G07' })).toEqual({ state: 'notice', notice: 'Nur mit OIDC-Anmeldung verfügbar.' });
|
|
});
|
|
test('401 (nicht angemeldet): Panel bleibt unsichtbar', ()=>{
|
|
expect(classifyListError({ status: 401, HBErrorCode: '04' })).toEqual({ state: 'hidden' });
|
|
});
|
|
test('andere Fehler (G05-503, 500, Netzwerk): Panel mit Fehlermeldung, kein Hinweis', ()=>{
|
|
expect(classifyListError({ status: 503, HBErrorCode: 'G05' }).state).toBe('error');
|
|
expect(classifyListError({ status: 500 }).state).toBe('error');
|
|
expect(classifyListError(new Error('offline')).state).toBe('error');
|
|
});
|
|
});
|