import { describe, expect, it } from 'vitest';
import { bonusLabel } from './boardlabels';

describe('bonusLabel', () => {
  it('none mode and plain squares have no label', () => {
    expect(bonusLabel('none', 'TW', 'en')).toBeNull();
    expect(bonusLabel('beginner', '', 'en')).toBeNull();
  });

  it('classic is a localized single tag', () => {
    expect(bonusLabel('classic', 'TW', 'en')).toEqual({ kind: 'single', text: '3W' });
    expect(bonusLabel('classic', 'DL', 'en')).toEqual({ kind: 'single', text: '2L' });
    expect(bonusLabel('classic', 'TW', 'ru')).toEqual({ kind: 'single', text: '3С' });
    expect(bonusLabel('classic', 'DL', 'ru')).toEqual({ kind: 'single', text: '2Б' });
  });

  it('beginner is a localized split label', () => {
    expect(bonusLabel('beginner', 'TW', 'en')).toEqual({ kind: 'split', top: '3×', bottom: 'word' });
    expect(bonusLabel('beginner', 'DL', 'en')).toEqual({ kind: 'split', top: '2×', bottom: 'letter' });
    expect(bonusLabel('beginner', 'TL', 'ru')).toEqual({ kind: 'split', top: '3×', bottom: 'буква' });
  });
});
