website refactor

This commit is contained in:
2026-01-12 01:01:49 +01:00
parent 5ca6023a5a
commit fefd8d1cd6
294 changed files with 4628 additions and 4991 deletions

View File

@@ -1,6 +1,6 @@
import { describe, it, expect, vi, Mocked } from 'vitest';
import { LeagueWalletService } from './LeagueWalletService';
import { WalletsApiClient } from '../../api/wallets/WalletsApiClient';
import { WalletsApiClient } from '@/lib/api/wallets/WalletsApiClient';
import { LeagueWalletViewModel } from '@/lib/view-models/LeagueWalletViewModel';
describe('LeagueWalletService', () => {
@@ -97,27 +97,5 @@ describe('LeagueWalletService', () => {
await expect(service.withdraw(leagueId, amount, currency, seasonId, destinationAccount)).rejects.toThrow('Withdrawal failed');
});
it('should block multiple rapid calls due to throttle', async () => {
const leagueId = 'league-123';
const amount = 500;
const currency = 'USD';
const seasonId = 'season-456';
const destinationAccount = 'account-789';
const mockResponse = { success: true };
mockApiClient.withdrawFromLeagueWallet.mockResolvedValue(mockResponse);
// First call should succeed
await service.withdraw(leagueId, amount, currency, seasonId, destinationAccount);
// Reset mock
mockApiClient.withdrawFromLeagueWallet.mockClear();
// Immediate second call should be blocked by throttle and throw error
await expect(service.withdraw(leagueId, amount, currency, seasonId, destinationAccount)).rejects.toThrow('Request blocked due to rate limiting');
expect(mockApiClient.withdrawFromLeagueWallet).not.toHaveBeenCalled();
});
});
});