import { describe, expect, it } from 'vitest';
import { getProjectWorkspace, workbenchProjects } from './mockData';

describe('workbench mock data', () => {
  it('provides dynamic projects', () => {
    expect(workbenchProjects.length).toBeGreaterThanOrEqual(2);
    expect(workbenchProjects[0]).toMatchObject({ id: expect.any(Number), name: expect.any(String) });
  });

  it('loads project-specific channels and counts', () => {
    const first = getProjectWorkspace(workbenchProjects[0].id);
    const second = getProjectWorkspace(workbenchProjects[1].id);

    expect(first.project.id).not.toBe(second.project.id);
    expect(first.channels.map((channel) => channel.type)).toEqual([
      'overview',
      'inbox',
      'tasks',
      'ai_sessions',
      'notes_sources',
      'cron',
      'custom_link',
    ]);
    expect(first.channels.find((channel) => channel.type === 'custom_link')).toMatchObject({
      title: expect.any(String),
      url: expect.stringMatching(/^https?:\/\//),
    });
  });
});
