import { describe, it, expect } from 'vitest';
import { shouldAutoFocus } from './live-workspace';

describe('shouldAutoFocus', () => {
  it('true only for browser/ssh tabs with a selected task', () => {
    expect(shouldAutoFocus('browser', true)).toBe(true);
    expect(shouldAutoFocus('ssh', true)).toBe(true);
  });
  it('false for non-live tabs', () => {
    expect(shouldAutoFocus('overview', true)).toBe(false);
    expect(shouldAutoFocus('files', true)).toBe(false);
    expect(shouldAutoFocus('trace', true)).toBe(false);
    expect(shouldAutoFocus('activity', true)).toBe(false);
  });
  it('false when no task is selected', () => {
    expect(shouldAutoFocus('browser', false)).toBe(false);
    expect(shouldAutoFocus('ssh', false)).toBe(false);
  });
});
