chore: baseline plantilla-proyectos como base del CRM

This commit is contained in:
Aduanasoft
2026-07-14 09:03:52 -06:00
commit c3d0eedc8d
469 changed files with 69739 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
import { describe, expect, it } from 'vitest';
import { resolveUserAvatarUrl } from './utils';
describe('resolveUserAvatarUrl', () => {
it('prioriza avatar de Workspace cuando es URL absoluta', () => {
const value = resolveUserAvatarUrl('https://hub.example.com/media/avatar.png', '/uploads/legacy.png');
expect(value).toBe('https://hub.example.com/media/avatar.png');
});
it('acepta avatar de Workspace relativo cuando no hay VITE_HUB_URL', () => {
const value = resolveUserAvatarUrl('/media/avatar.png', '/uploads/legacy.png');
expect(value).toBe('/media/avatar.png');
});
it('usa avatar legado cuando Workspace no existe', () => {
const value = resolveUserAvatarUrl(null, '/uploads/legacy.png');
expect(value).toBe('http://localhost:8000/uploads/legacy.png');
});
it('retorna vacio para fallback visual cuando no hay ninguna imagen', () => {
const value = resolveUserAvatarUrl(null, null);
expect(value).toBe('');
});
});