import { describe, it, expect } from 'vitest';
import { MEMORY_CATEGORIES, isMemoryCategory, categoryNamespace } from './categories.js';

describe('memory categories', () => {
  it('exposes expected categories', () => {
    expect(MEMORY_CATEGORIES).toEqual(['facts', 'preferences', 'decisions', 'projects']);
  });

  it('validates category names', () => {
    expect(isMemoryCategory('facts')).toBe(true);
    expect(isMemoryCategory('preferences')).toBe(true);
    expect(isMemoryCategory('decisions')).toBe(true);
    expect(isMemoryCategory('projects')).toBe(true);
    expect(isMemoryCategory('unknown')).toBe(false);
    expect(isMemoryCategory('')).toBe(false);
  });

  it('builds category namespaces', () => {
    expect(categoryNamespace('user', 'facts')).toBe('user/facts');
    expect(categoryNamespace('global', 'decisions')).toBe('global/decisions');
    expect(categoryNamespace('sessions/abc123', 'projects')).toBe('sessions/abc123/projects');
  });
});
