feat: connect tournament views to APIs and recover archived stats
Remove development previews and complete hall of fame, match history, official results, and multi-kill API integration. Fix active match pagination and team-ready controls, preserve basic scoreboards, and recover statistics when Riot archives arrive. Use bounded in-process cache invalidation retries and add the Riot match lookup index migration with regression coverage.
This commit is contained in:
1 parent
20e1e6ec04
commit
0d7617e2d2
70 files changed
+3739
-1793
No files matched your search
@@ -78,6 +78,8 @@ describe('AuctionGateway', () => {
|
||||
expect(broadcast).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
const bidderUserId = new mongoose.Types.ObjectId();
|
||||
|
||||
function createGateway(params?: {
|
||||
getCurrentRedisTimestampMS?: jest.Mock;
|
||||
placeBidDelta?: jest.Mock;
|
||||
@@ -112,6 +114,23 @@ describe('AuctionGateway', () => {
|
||||
};
|
||||
}
|
||||
|
||||
it('requires an authenticated user before forwarding a bid', async () => {
|
||||
const matchId = new mongoose.Types.ObjectId().toString();
|
||||
const { gateway, auctionService } = createGateway();
|
||||
const ack = jest.fn();
|
||||
|
||||
await gateway.handleBid(
|
||||
{ data: { matchId }, emit: jest.fn() } as never,
|
||||
{ bidderTeamIndex: 1, bidPointAmount: 100 },
|
||||
ack,
|
||||
);
|
||||
|
||||
expect(auctionService.placeBidDelta).not.toHaveBeenCalled();
|
||||
expect(ack).toHaveBeenCalledWith(
|
||||
expect.objectContaining({ rejected: true }),
|
||||
);
|
||||
});
|
||||
|
||||
it('broadcasts a bid delta and acknowledges the matching bid request', async () => {
|
||||
const matchId = new mongoose.Types.ObjectId().toString();
|
||||
const auctionBidHistoryEntry = {
|
||||
@@ -133,7 +152,10 @@ describe('AuctionGateway', () => {
|
||||
const ack = jest.fn();
|
||||
|
||||
await gateway.handleBid(
|
||||
{ data: { matchId }, emit: jest.fn() } as never,
|
||||
{
|
||||
data: { matchId, user: { _id: bidderUserId } },
|
||||
emit: jest.fn(),
|
||||
} as never,
|
||||
{
|
||||
bidPointAmount: 120,
|
||||
bidderTeamIndex: 2,
|
||||
@@ -147,6 +169,7 @@ describe('AuctionGateway', () => {
|
||||
expect(placeBidDelta).toHaveBeenCalledWith({
|
||||
amount: 120,
|
||||
bidRequestId: 'bid-1',
|
||||
bidderUserId,
|
||||
clientObservedAuctionLifecycleId: 'life-1',
|
||||
clientObservedCurrentBidRoundPlayerUserId: 'player-1',
|
||||
matchId: new mongoose.Types.ObjectId(matchId),
|
||||
@@ -200,7 +223,10 @@ describe('AuctionGateway', () => {
|
||||
const ack = jest.fn();
|
||||
|
||||
await gateway.handleBid(
|
||||
{ data: { matchId }, emit: jest.fn() } as never,
|
||||
{
|
||||
data: { matchId, user: { _id: bidderUserId } },
|
||||
emit: jest.fn(),
|
||||
} as never,
|
||||
{
|
||||
bidPointAmount: 50,
|
||||
bidderTeamIndex: 1,
|
||||
@@ -247,7 +273,10 @@ describe('AuctionGateway', () => {
|
||||
const ack = jest.fn();
|
||||
|
||||
await gateway.handleBid(
|
||||
{ data: { matchId }, emit: socketEmit } as never,
|
||||
{
|
||||
data: { matchId, user: { _id: bidderUserId } },
|
||||
emit: socketEmit,
|
||||
} as never,
|
||||
{
|
||||
bidPointAmount: 50,
|
||||
bidderTeamIndex: 1,
|
||||
@@ -318,7 +347,10 @@ describe('AuctionGateway', () => {
|
||||
revision: 3,
|
||||
});
|
||||
const socketEmit = jest.fn();
|
||||
const socket = { data: { matchId }, emit: socketEmit };
|
||||
const socket = {
|
||||
data: { matchId, user: { _id: bidderUserId } },
|
||||
emit: socketEmit,
|
||||
};
|
||||
const { gateway } = createGateway({ placeBidDelta });
|
||||
const acknowledgements: Array<Record<string, unknown>> = [];
|
||||
|
||||
@@ -359,7 +391,10 @@ describe('AuctionGateway', () => {
|
||||
currentHighestBidPointAmount: 50,
|
||||
revision: 3,
|
||||
});
|
||||
const socket = { data: { matchId }, emit: jest.fn() };
|
||||
const socket = {
|
||||
data: { matchId, user: { _id: bidderUserId } },
|
||||
emit: jest.fn(),
|
||||
};
|
||||
const { gateway } = createGateway({ placeBidDelta });
|
||||
|
||||
for (let index = 0; index < 8; index += 1) {
|
||||
|
||||
Reference in new issue
Block a user