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

describe('toAbbreviation', () => {
  it('should return the abbreviated version of a string', () => {
    const fixtures = [
      ['0xABCDEF1234567890', '0xABCD…7890'],
      ['ABCDEF1234567890', 'ABCD…7890'],
      ['ABCD', 'ABCD'],
      ['0xABCDE…7890', '0xABCD…7890'],
      ['0x1234', '0x1234'],
      ['1234', '1234'],
    ] as const;
    for (const [input, expected] of fixtures) {
      expect(toAbbreviation(input)).toBe(expected);
    }
  });
});
