Skip to content

test: lock that the deck list omits cards - #58

Merged
lesnik512 merged 1 commit into
mainfrom
test/list-decks-omits-cards
Jun 26, 2026
Merged

test: lock that the deck list omits cards#58
lesnik512 merged 1 commit into
mainfrom
test/list-decks-omits-cards

Conversation

@lesnik512

Copy link
Copy Markdown
Member

Context

Ports the regression test from litestar-sqlalchemy-template#33, adapted to this repo's from fastapi import status convention.

Why

The Deck response contract is deliberately two-shaped (per CLAUDE.md): light schemas.Deck for list_decks/create_deck/update_deck (no cards), and schemas.DeckWithCards for get_deck. No test asserted that cards is absent from list responses, so that half of the contract wasn't pinned — existing tests would pass even if cards leaked back into the light schema.

What

test_list_decks_omits_cards creates a deck with a card, then asserts the list item has no cards key. It would catch a regression that re-added cards to the light contract. test_get_one_deck already locks the other half (detail includes cards).

Full suite: 21 passed, 100% coverage. Lint + ty clean.

🤖 Generated with Claude Code

Port the regression test from litestar-sqlalchemy-template#33. The Deck
response contract is two-shaped: light `Deck` for list/create/update,
`DeckWithCards` for get_deck. No test asserted that `cards` is absent
from list responses, so the contract wasn't pinned — the existing tests
passed under both the old single-schema design and the split.

test_list_decks_omits_cards creates a deck with a card, then asserts the
list item has no `cards` key. It would catch a regression that re-added
`cards` to the light contract. test_get_one_deck already locks the other
half (detail includes cards).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@lesnik512
lesnik512 merged commit 3dd4a6d into main Jun 26, 2026
2 checks passed
@lesnik512
lesnik512 deleted the test/list-decks-omits-cards branch June 26, 2026 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant