import { TeamRole, canBook, canInvite } from './team-role.model';

describe('team-role permissions', () => {
  it('canBook is false for Player', () => {
    expect(canBook(TeamRole.Player)).toBe(false);
  });

  it('canBook is true from ScndTreasurer upwards', () => {
    expect(canBook(TeamRole.ScndTreasurer)).toBe(true);
    expect(canBook(TeamRole.Captain)).toBe(true);
    expect(canBook(TeamRole.Treasurer)).toBe(true);
    expect(canBook(TeamRole.Coach)).toBe(true);
  });

  it('canInvite is false for Player and ScndTreasurer', () => {
    expect(canInvite(TeamRole.Player)).toBe(false);
    expect(canInvite(TeamRole.ScndTreasurer)).toBe(false);
  });

  it('canInvite is true above ScndTreasurer', () => {
    expect(canInvite(TeamRole.Captain)).toBe(true);
    expect(canInvite(TeamRole.Treasurer)).toBe(true);
    expect(canInvite(TeamRole.Coach)).toBe(true);
  });
});
