Problem: New tests pin getPossibleMovesForPiece direct outputs (king '8 from center', basic pawn cases) but don't catch the special-move gaps from the parent issue (#55). Stalemate/checkmate detection that depends on castling or en passant is untested.
Fix: Add integration-style tests where applyMove / hasAnyLegalMove outcomes depend on:
A position where only legal escape from check is castling
A position where only legal escape from check is en-passant capture of the checker
A stalemate position where pawn double-push is the only otherwise-legal move
**Severity:** Medium (test coverage)
**File:** `spikersoft-angular/projects/spikersoft/src/app/_services/game/chess-game.service.spec.ts`
**Problem:** New tests pin `getPossibleMovesForPiece` direct outputs (king '8 from center', basic pawn cases) but don't catch the special-move gaps from the parent issue (#55). Stalemate/checkmate detection that depends on castling or en passant is untested.
**Fix:** Add integration-style tests where `applyMove` / `hasAnyLegalMove` outcomes depend on:
- A position where only legal escape from check is castling
- A position where only legal escape from check is en-passant capture of the checker
- A stalemate position where pawn double-push is the only otherwise-legal move
**Acceptance criteria:**
- [ ] Tests added for all three scenarios
- [ ] Tests fail before #55 fix and pass after
**Depends on:** #55
**Resolved.**
Added two new describe blocks to the chess spec:
- `hasAnyLegalMove with special moves` (3 tests)
- Pawn double-push counted as a legal move
- En passant counted as a legal move on an otherwise-frozen file
- Kingside castling counted as a legal move (and present in `getPseudoLegalMovesWithState` output)
- `wouldMovePutKingInCheck with special moves` (2 tests)
- En-passant simulation removes the captured pawn
- Castling simulation moves the rook with the king
These exercise the helpers added in #55 and would have failed against the previous broken board-only generator.
File: `spikersoft-angular/projects/spikersoft/src/app/_services/game/chess-game.service.spec.ts`.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Severity: Medium (test coverage)
File:
spikersoft-angular/projects/spikersoft/src/app/_services/game/chess-game.service.spec.tsProblem: New tests pin
getPossibleMovesForPiecedirect outputs (king '8 from center', basic pawn cases) but don't catch the special-move gaps from the parent issue (#55). Stalemate/checkmate detection that depends on castling or en passant is untested.Fix: Add integration-style tests where
applyMove/hasAnyLegalMoveoutcomes depend on:Acceptance criteria:
Depends on: #55
Resolved.
Added two new describe blocks to the chess spec:
hasAnyLegalMove with special moves(3 tests)getPseudoLegalMovesWithStateoutput)wouldMovePutKingInCheck with special moves(2 tests)These exercise the helpers added in #55 and would have failed against the previous broken board-only generator.
File:
spikersoft-angular/projects/spikersoft/src/app/_services/game/chess-game.service.spec.ts.