import { describe, expect, it } from 'vitest';
import { isSafetyDraftValid } from '@/business/safety-protocols/selectors';
import type { SafetyProtocolDraft } from '@/business/safety-protocols/types';

const validDraft: SafetyProtocolDraft = {
  title: 'Fire Drill',
  tag: 'fire',
  steps: ['', 'Walk to assembly point'],
  autismConsiderations: [''],
};

describe('safety protocol selectors', () => {
  it('requires a title and at least one non-empty step', () => {
    expect(isSafetyDraftValid(validDraft)).toBe(true);
    expect(isSafetyDraftValid({ ...validDraft, title: '   ' })).toBe(false);
    expect(isSafetyDraftValid({ ...validDraft, steps: ['', '  '] })).toBe(false);
  });
});
