import { describe, expect, it } from 'vitest';

import { __mlbPropInternals } from '../grok';

describe('total signal benchmark', () => {
  it('keeps half-run MLB totals edges once edge compression is relaxed', () => {
    expect(__mlbPropInternals.deriveTotalSignal({
      league: 'mlb',
      projectedTotal: 9,
      marketTotal: 8.5,
    })).toEqual({
      direction: 'OVER',
      edge: 0.5,
    });
  });

  it('preserves meaningful MLB totals edges', () => {
    expect(__mlbPropInternals.deriveTotalSignal({
      league: 'mlb',
      projectedTotal: 9.5,
      marketTotal: 8.5,
    })).toEqual({
      direction: 'OVER',
      edge: 1,
    });

    expect(__mlbPropInternals.deriveTotalSignal({
      league: 'mlb',
      projectedTotal: 7.5,
      marketTotal: 8.5,
    })).toEqual({
      direction: 'UNDER',
      edge: -1,
    });
  });

  it('keeps non-MLB totals behavior unchanged', () => {
    expect(__mlbPropInternals.deriveTotalSignal({
      league: 'nba',
      projectedTotal: 231,
      marketTotal: 230.5,
    })).toEqual({
      direction: 'OVER',
      edge: 0.5,
    });
  });
});
