27 lines
839 B
TypeScript
27 lines
839 B
TypeScript
import { describe, it, expect } from 'vitest';
|
|
import { LeagueWalletId } from './LeagueWalletId';
|
|
|
|
describe('LeagueWalletId', () => {
|
|
it('should create a league wallet id', () => {
|
|
const id = LeagueWalletId.create('wallet1');
|
|
expect(id.toString()).toBe('wallet1');
|
|
});
|
|
|
|
it('should throw on empty id', () => {
|
|
expect(() => LeagueWalletId.create('')).toThrow('LeagueWallet ID cannot be empty');
|
|
});
|
|
|
|
it('should trim whitespace', () => {
|
|
const id = LeagueWalletId.create(' wallet1 ');
|
|
expect(id.toString()).toBe('wallet1');
|
|
});
|
|
|
|
it('should check equality', () => {
|
|
const id1 = LeagueWalletId.create('wallet1');
|
|
const id2 = LeagueWalletId.create('wallet1');
|
|
const id3 = LeagueWalletId.create('wallet2');
|
|
|
|
expect(id1.equals(id2)).toBe(true);
|
|
expect(id1.equals(id3)).toBe(false);
|
|
});
|
|
}); |