All files / client/src/utils getAttendeeType.ts

80% Statements 4/5
90% Branches 9/10
100% Functions 1/1
80% Lines 4/5

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28                356x 1123x         1085x             38x            
import { ProgramType } from "shared/types/models/programItem";
import { exhaustiveSwitchGuard } from "shared/utils/exhaustiveSwitchGuard";
 
enum AttendeeType {
  Player = "player",
  Participant = "participant",
}
 
export const getAttendeeType = (programType: ProgramType): AttendeeType => {
  switch (programType) {
    case ProgramType.TABLETOP_RPG:
    case ProgramType.LARP:
    case ProgramType.EXPERIENCE_POINT:
    case ProgramType.OTHER_GAMING:
      return AttendeeType.Player;
 
    case ProgramType.TOURNAMENT:
    case ProgramType.WORKSHOP:
    case ProgramType.OTHER:
    case ProgramType.ROUNDTABLE_DISCUSSION:
    case ProgramType.FLEAMARKET:
      return AttendeeType.Participant;
 
    default:
      return exhaustiveSwitchGuard(programType);
  }
};