import { describe, expect, it } from 'vitest';
import { nameToInitials } from '../../components/PresenceChips.js';
describe('nameToInitials', () => {
    it('returns the first letter of a single name', () => {
        expect(nameToInitials('Alice')).toBe('A');
    });
    it('returns the first letter of two name parts', () => {
        expect(nameToInitials('Alice Cooper')).toBe('AC');
    });
    it('caps at two letters for three+ part names', () => {
        expect(nameToInitials('Mary Jane Watson')).toBe('MJ');
    });
    it('uppercases the result', () => {
        expect(nameToInitials('alice cooper')).toBe('AC');
    });
    it('trims surrounding whitespace before processing', () => {
        expect(nameToInitials('  Alice  ')).toBe('A');
    });
    it('collapses multiple whitespace separators', () => {
        expect(nameToInitials('Alice    Cooper')).toBe('AC');
    });
    it('falls back to "?" for an empty string', () => {
        expect(nameToInitials('')).toBe('?');
    });
    it('falls back to "?" for a whitespace-only string', () => {
        expect(nameToInitials('   ')).toBe('?');
    });
    it('handles a single emoji name without crashing', () => {
        const result = nameToInitials('🐱 Whiskers');
        // JS upper-case is a no-op for the cat — test just confirms we don't crash
        // and return *something* with two character-positions.
        expect(result.length).toBeGreaterThan(0);
    });
});
//# sourceMappingURL=presence-chips-helpers.test.js.map