website refactor
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { LeagueWalletViewModel } from './LeagueWalletViewModel';
|
||||
import { WalletTransactionViewModel } from './WalletTransactionViewModel';
|
||||
import { WalletTransactionViewModel, FullTransactionDto } from './WalletTransactionViewModel';
|
||||
|
||||
const createTransaction = (overrides: Partial<WalletTransactionViewModel> = {}): WalletTransactionViewModel =>
|
||||
const createTransaction = (overrides: Partial<FullTransactionDto> = {}): WalletTransactionViewModel =>
|
||||
new WalletTransactionViewModel({
|
||||
id: 'tx-1',
|
||||
type: 'sponsorship',
|
||||
@@ -13,7 +13,7 @@ const createTransaction = (overrides: Partial<WalletTransactionViewModel> = {}):
|
||||
date: new Date('2024-01-01T00:00:00Z'),
|
||||
status: 'completed',
|
||||
reference: 'ref-1',
|
||||
...(overrides as any),
|
||||
...overrides,
|
||||
});
|
||||
|
||||
describe('LeagueWalletViewModel', () => {
|
||||
@@ -62,10 +62,10 @@ describe('LeagueWalletViewModel', () => {
|
||||
});
|
||||
|
||||
it('filters transactions by type and supports all', () => {
|
||||
const sponsorshipTx = createTransaction({ type: 'sponsorship' as any });
|
||||
const membershipTx = createTransaction({ type: 'membership' as any, id: 'tx-2' });
|
||||
const withdrawalTx = createTransaction({ type: 'withdrawal' as any, id: 'tx-3' });
|
||||
const prizeTx = createTransaction({ type: 'prize' as any, id: 'tx-4' });
|
||||
const sponsorshipTx = createTransaction({ type: 'sponsorship' });
|
||||
const membershipTx = createTransaction({ type: 'membership', id: 'tx-2' });
|
||||
const withdrawalTx = createTransaction({ type: 'withdrawal', id: 'tx-3' });
|
||||
const prizeTx = createTransaction({ type: 'prize', id: 'tx-4' });
|
||||
|
||||
const vm = new LeagueWalletViewModel({
|
||||
balance: 0,
|
||||
|
||||
Reference in New Issue
Block a user