diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-02-15 17:09:51 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-02-15 17:11:00 +0900 |
| commit | 95bb8c70a98fabae2a60b251489a59065b2978d1 (patch) | |
| tree | a145f686cc2d84f49979ea97b9054413f9e58306 /src/client/pages/DeckCardsPage.test.tsx | |
| parent | 897f22233810919ba01608bffbfa69f2bb926388 (diff) | |
| download | kioku-95bb8c70a98fabae2a60b251489a59065b2978d1.tar.gz kioku-95bb8c70a98fabae2a60b251489a59065b2978d1.tar.zst kioku-95bb8c70a98fabae2a60b251489a59065b2978d1.zip | |
fix(types): use CardStateType instead of number for card state fields
Card and StudyCard interfaces used generic number for state, causing
type errors when indexing Record<CardStateType, ...> maps. Also adds
missing FSRS fields to client Card interface to match API response.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'src/client/pages/DeckCardsPage.test.tsx')
| -rw-r--r-- | src/client/pages/DeckCardsPage.test.tsx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/client/pages/DeckCardsPage.test.tsx b/src/client/pages/DeckCardsPage.test.tsx index 91b0b28..48cc0e3 100644 --- a/src/client/pages/DeckCardsPage.test.tsx +++ b/src/client/pages/DeckCardsPage.test.tsx @@ -10,6 +10,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import { Route, Router } from "wouter"; import { memoryLocation } from "wouter/memory-location"; import { authLoadingAtom, type Card, type Deck } from "../atoms"; +import { CardState } from "../db"; import { DeckCardsPage } from "./DeckCardsPage"; const mockDeckGet = vi.fn(); @@ -87,7 +88,7 @@ const mockBasicCards = [ isReversed: false, front: "Hello", back: "こんにちは", - state: 0, + state: CardState.New, due: "2024-01-01T00:00:00Z", stability: 0, difficulty: 0, @@ -108,7 +109,7 @@ const mockBasicCards = [ isReversed: false, front: "Goodbye", back: "さようなら", - state: 2, + state: CardState.Review, due: "2024-01-02T00:00:00Z", stability: 5.5, difficulty: 5.0, @@ -133,7 +134,7 @@ const mockNoteBasedCards = [ isReversed: false, front: "Apple", back: "りんご", - state: 0, + state: CardState.New, due: "2024-01-01T00:00:00Z", stability: 0, difficulty: 0, @@ -154,7 +155,7 @@ const mockNoteBasedCards = [ isReversed: true, front: "りんご", back: "Apple", - state: 0, + state: CardState.New, due: "2024-01-01T00:00:00Z", stability: 0, difficulty: 0, |
