import { resolveSelectionCode } from './settlement-helpers';

describe('resolveSelectionCode', () => {
  it('prefers database selection code', () => {
    expect(resolveSelectionCode('UNDER', '小 2.5')).toBe('UNDER');
  });

  it('maps Chinese snapshot names when code is missing', () => {
    expect(resolveSelectionCode(null, '主胜')).toBe('HOME');
    expect(resolveSelectionCode('', '小 2.5')).toBe('UNDER');
    expect(resolveSelectionCode(undefined, '大 2.5')).toBe('OVER');
    expect(resolveSelectionCode(null, '主 -0.5')).toBe('HOME');
  });
});
