49 lines
1.4 KiB
TypeScript
49 lines
1.4 KiB
TypeScript
import { describe, it, expect } from 'vitest';
|
|
import { MemberFormatter } from './MemberFormatter';
|
|
|
|
describe('MemberFormatter', () => {
|
|
describe('formatCount', () => {
|
|
it('should format 1 member correctly', () => {
|
|
expect(MemberFormatter.formatCount(1)).toBe('1 member');
|
|
});
|
|
|
|
it('should format 2 members correctly', () => {
|
|
expect(MemberFormatter.formatCount(2)).toBe('2 members');
|
|
});
|
|
|
|
it('should format 0 members correctly', () => {
|
|
expect(MemberFormatter.formatCount(0)).toBe('0 members');
|
|
});
|
|
|
|
it('should format large numbers correctly', () => {
|
|
expect(MemberFormatter.formatCount(100)).toBe('100 members');
|
|
});
|
|
|
|
it('should handle negative numbers', () => {
|
|
expect(MemberFormatter.formatCount(-1)).toBe('-1 members');
|
|
});
|
|
});
|
|
|
|
describe('formatUnits', () => {
|
|
it('should format 1 unit correctly', () => {
|
|
expect(MemberFormatter.formatUnits(1)).toBe('1 Unit');
|
|
});
|
|
|
|
it('should format 2 units correctly', () => {
|
|
expect(MemberFormatter.formatUnits(2)).toBe('2 Units');
|
|
});
|
|
|
|
it('should format 0 units correctly', () => {
|
|
expect(MemberFormatter.formatUnits(0)).toBe('0 Units');
|
|
});
|
|
|
|
it('should format large numbers correctly', () => {
|
|
expect(MemberFormatter.formatUnits(100)).toBe('100 Units');
|
|
});
|
|
|
|
it('should handle negative numbers', () => {
|
|
expect(MemberFormatter.formatUnits(-1)).toBe('-1 Units');
|
|
});
|
|
});
|
|
});
|