import { describe, expect, it } from 'vitest';
import { canEditFrameEntries } from '@/business/frame/selectors';
import type { UserRole } from '@/shared/types/app';

describe('frame selectors', () => {
  it('allows director and superintendent users to edit FRAME entries', () => {
    const editorRoles: readonly UserRole[] = ['director', 'superintendent'];

    expect(editorRoles.map((role) => canEditFrameEntries(role))).toEqual([true, true]);
  });

  it('keeps staff roles read-only for FRAME entries', () => {
    const readOnlyRoles: readonly UserRole[] = ['teacher', 'support_staff', 'office_manager'];

    expect(readOnlyRoles.map((role) => canEditFrameEntries(role))).toEqual([false, false, false]);
  });
});
