feat: update package copy and admin control room

This commit is contained in:
Codex Agent
2026-01-15 19:54:04 +01:00
parent ad829ae509
commit 7e32d8f706
42 changed files with 1310 additions and 2017 deletions

View File

@@ -0,0 +1,47 @@
import { describe, expect, it } from 'vitest';
import { normalizeLiveStatus, resolveLiveShowApproveMode, resolveStatusTone } from './controlRoom';
describe('normalizeLiveStatus', () => {
it('maps nullish statuses to none', () => {
expect(normalizeLiveStatus(null)).toBe('none');
expect(normalizeLiveStatus(undefined)).toBe('none');
expect(normalizeLiveStatus('')).toBe('none');
});
it('passes through supported statuses', () => {
expect(normalizeLiveStatus('pending')).toBe('pending');
expect(normalizeLiveStatus('approved')).toBe('approved');
expect(normalizeLiveStatus('rejected')).toBe('rejected');
});
});
describe('resolveLiveShowApproveMode', () => {
it('prefers approve-and-live for pending gallery', () => {
expect(resolveLiveShowApproveMode('pending')).toBe('approve-and-live');
});
it('returns approve-only for approved gallery', () => {
expect(resolveLiveShowApproveMode('approved')).toBe('approve-only');
});
it('returns not-eligible for rejected or hidden gallery', () => {
expect(resolveLiveShowApproveMode('rejected')).toBe('not-eligible');
expect(resolveLiveShowApproveMode('hidden')).toBe('not-eligible');
});
});
describe('resolveStatusTone', () => {
it('maps approved to success', () => {
expect(resolveStatusTone('approved')).toBe('success');
});
it('maps pending to warning', () => {
expect(resolveStatusTone('pending')).toBe('warning');
});
it('maps other statuses to muted', () => {
expect(resolveStatusTone('rejected')).toBe('muted');
expect(resolveStatusTone('hidden')).toBe('muted');
expect(resolveStatusTone(undefined)).toBe('muted');
});
});