All files / src/features/Merchants/MerchantSidePanel/components/RiskSection/manualRiskLevel riskLevelOrder.ts

100% Statements 3/3
100% Branches 0/0
100% Functions 1/1
100% Lines 3/3

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    2x             2x     116x  
import { TRiskLevel } from "@components/Merchants/MerchantPreview/RiskProfile/types";
 
export const RISK_LEVEL_ORDER: Record<TRiskLevel, number> = {
  low: 0,
  medium: 1,
  high: 2,
  critical: 3,
};
 
export const isBelowComputed = (
  selected: TRiskLevel,
  computed: TRiskLevel,
): boolean => RISK_LEVEL_ORDER[selected] < RISK_LEVEL_ORDER[computed];