You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**Duel team sizes:** accepts 1 player, accepts exactly 2 players
115
115
-**Player verification:** rejects banned player, rejects player with matchmaking cooldown, rejects player already in another match, rejects player already in a different queue, accepts player in same lobby
116
+
-**getPlayerLobby:** returns solo player lobby when no lobby exists, returns lobby with multiple players for valid UUID, falls back to solo when lobby query returns null
117
+
-**setLobbyDetails:** stores correct ELO data and avgRank in Redis, defaults ELO to 5000 for missing data, uses match type to look up correct ELO field
118
+
-**removeLobbyDetails:** does nothing when details don't exist, removes details and notifies all players
119
+
-**getLobbyDetails:** returns undefined when no data in Redis, returns parsed details with 1-based region positions
120
+
-**setMatchConformationIdForLobby / removeConfirmationIdFromLobby:** stores and removes confirmation ID in Redis hash
121
+
-**removeLobbyFromQueue:** returns false when lobby not found, removes from queue and rank sorted sets per region
122
+
-**sendQueueDetailsToLobby:** returns early when details don't exist, publishes details without confirmation data
123
+
-**sendQueueDetailsToAllUsers:** queries correct cache key, sends details to all lobbies
124
+
-**sendQueueDetailsToPlayer:** does nothing when no queue details exist
116
125
117
126
#### `src/matches/match-assistant/match-assistant.service.spec.ts` — Match Assistant (16 tests)
118
127
Tests match lifecycle management (scheduling, canceling, server assignment, maps).
@@ -126,6 +135,29 @@ Tests match lifecycle management (scheduling, canceling, server assignment, maps
126
135
-**isDedicatedServerAvailable:** throws when match has no server
127
136
-**getAvailableMaps:** filters out banned and picked maps, throws when map pool not found
128
137
138
+
#### `src/dedicated-servers/dedicated-servers.service.spec.ts` — Dedicated Server Management (22 tests)
139
+
Tests K8s deployment lifecycle, game server configuration, RCON ping, and Redis stats.
-**getGameType (private):** returns 0 for Ranked/Casual/Competitive/Wingman, 1 for Deathmatch/ArmsRace, 3 for Retake/Custom
142
+
-**getGameMode (private):** returns 1 for Ranked/Competitive, 0 for ArmsRace/Casual/Retake/Custom, 2 for Wingman/Deathmatch
143
+
-**getWarGameType (private):** returns 12 for Retake, 0 for all others
144
+
-**getDedicatedServerDeploymentName (private):** returns `dedicated-server-{serverId}` format
145
+
-**getAllDedicatedServerStats:** returns empty array for no data/null, parses valid server data, filters malformed JSON, returns empty on Redis error
146
+
-**restartDedicatedServer:** delegates to systemService.restartDeployment with correct namespace
147
+
-**pingDedicatedServer:** marks server connected when not already, stores stats in Redis with TTL, handles csgo text-based status parsing, disconnects RCON after ping
148
+
149
+
#### `src/hasura/hasura.service.spec.ts` — Hasura GraphQL & Migration Service (30 tests)
-**calcSqlDigest:** SHA-256 for string and array inputs, consistent hashing, different inputs produce different digests
154
+
-**getHasuraHeaders:** returns role/id headers, uses correct cache key with TTL
155
+
-**query:** delegates to GraphQL client, extracts first error message from response errors, rethrows non-response errors
156
+
-**mutation:** delegates to GraphQL client, extracts first error message, rethrows non-response errors
157
+
-**getSetting:** returns hash from postgres, returns undefined when no row, wraps errors with context
158
+
-**setSetting:** upserts hash via postgres, wraps errors with context
159
+
-**apply:** recurses directories, skips when digest matches, applies when digest differs, applies when no prior setting exists, throws with file context on failure
160
+
129
161
#### `src/notifications/notifications.service.spec.ts` — Match Status Notifications (8 tests)
130
162
Tests match status notification dispatch with Discord webhook support.
131
163
-**Non-notifiable status:** skips statuses not in NOTIFIABLE_STATUSES
@@ -152,13 +184,19 @@ Tests system settings retrieval and updates.
152
184
-**Defaults:** applies default values when missing/null
#### `src/matches/match-relay/match-relay.service.spec.ts` — Match Relay Service (8 tests)
156
-
Tests match relay/broadcast service.
187
+
#### `src/matches/match-relay/match-relay.service.spec.ts` — Match Relay / GOTV Broadcast Service (52 tests)
188
+
Tests GOTV relaybroadcast management including fragment storage, sync info, and data streaming.
157
189
-**removeBroadcast:** removes broadcast data
158
-
-**getStart:** serves start fragment with 404 handling
159
-
-**getFragment:** retrieves broadcast fragments
160
-
-**isSyncReady:** validates sync readiness (requires full/delta data with ticks/timestamps)
161
-
-**cleanupOldFragments:** cleans old fragments while preserving index 0
190
+
-**getStart:** signup_fragment mismatch returns 404, gzipped start blob served with Content-Encoding header
191
+
-**getFragment:** broadcast not found returns 404, fragment not found returns 404, delta field served with gzip encoding
192
+
-**getSyncInfo:** broadcast not found, start with no data, start missing entirely, no sync-ready fragment returns 405, valid sync JSON without/with fragment param, clamping to signup_fragment, skipping non-sync-ready fragments, Expires header
193
+
-**postField:** new broadcast creation, fragment clearing on steamId/masterCookie mismatch, start field forces fragmentIndex=0, 205 for full/delta without start, gzip success/failure paths, signup_fragment initialization, query param copying, cleanupOldFragments called after store
194
+
-**isSyncReady:** validates sync readiness (requires full/delta data with ticks/timestamps), delta.tick as alternative, false for empty objects
195
+
-**cleanupOldFragments:** no-op when broadcast missing, preserves fragments without timestamp, keeps recent fragments
196
+
-**getMatchBroadcastEndTick:** empty map, highest endtick by descending key, skips fragments without endtick
197
+
-**getLastFragment:** empty map, highest key selection, single element
Tests Hasura auth webhook, action dispatch, and event handling.
245
+
-**hasura() GET:** returns guest headers when no user, returns user headers for authenticated user via hasuraService
246
+
-**actions() POST:** successful action resolution and response, 401 for unauthorized "me" action without user, 400 on handler throw with error message, 400 with string fallback error, injects user and session into input
247
+
-**events() POST:** successful event resolution, null old/new data coerced to empty objects, error logging without rethrowing
248
+
-**getResolver (private):** throws on unregistered action, caches resolved handler on repeat calls
249
+
205
250
#### `src/system/system.controller.spec.ts` — System Controller (13 tests)
206
251
Tests system controller endpoints and event handlers.
207
252
-**updateServices:** delegates to system.updateServices
0 commit comments