Skip to content

Commit c6aef8b

Browse files
TinyKittenclaude
andcommitted
テストデータにwantedDestinationIdを追加し型エラーとテスト失敗を修正
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 863ad2a commit c6aef8b

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

src/hooks/usePresetCarouselData.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const createLineRoute = (id: string, lineId: number): SavedRoute => ({
2929
name: `Route ${lineId}`,
3030
lineId,
3131
trainTypeId: null,
32+
wantedDestinationId: null,
3233
hasTrainType: false,
3334
createdAt: new Date('2024-01-01'),
3435
});
@@ -42,6 +43,7 @@ const createTrainTypeRoute = (
4243
name: `Route ${trainTypeId}`,
4344
lineId,
4445
trainTypeId,
46+
wantedDestinationId: null,
4547
hasTrainType: true,
4648
createdAt: new Date('2024-01-01'),
4749
});

src/hooks/useSavedRoutes.test.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ describe('useSavedRoutes', () => {
6565
}
6666
);
6767

68-
await waitFor(() => expect(mockDb.execAsync).toHaveBeenCalledTimes(4));
68+
await waitFor(() => expect(mockDb.execAsync).toHaveBeenCalledTimes(5));
6969
expect(mockDb.execAsync).toHaveBeenNthCalledWith(
7070
1,
7171
expect.stringContaining('CREATE TABLE IF NOT EXISTS saved_routes')
@@ -183,13 +183,15 @@ describe('useSavedRoutes', () => {
183183
hasTrainType: true,
184184
lineId: 1,
185185
trainTypeId: 9,
186+
wantedDestinationId: null,
186187
name: 'WithType',
187188
createdAt: new Date('2025-01-01T00:00:00.000Z'),
188189
};
189190
const withoutType: SavedRouteWithoutTrainTypeInput = {
190191
hasTrainType: false,
191192
lineId: 2,
192193
trainTypeId: null,
194+
wantedDestinationId: null,
193195
name: 'WithoutType',
194196
createdAt: new Date('2025-01-02T00:00:00.000Z'),
195197
};
@@ -227,6 +229,7 @@ describe('useSavedRoutes', () => {
227229
withType.name,
228230
withType.lineId,
229231
withType.trainTypeId,
232+
withType.wantedDestinationId,
230233
1,
231234
saved1Defined.createdAt.toISOString(),
232235
]
@@ -306,6 +309,7 @@ describe('useSavedRoutes', () => {
306309
hasTrainType: true,
307310
lineId: 100,
308311
trainTypeId: 7,
312+
wantedDestinationId: null,
309313
name: 'With Train Type',
310314
createdAt: new Date('2025-01-03T00:00:00.000Z'),
311315
};
@@ -314,6 +318,7 @@ describe('useSavedRoutes', () => {
314318
hasTrainType: false,
315319
lineId: 200,
316320
trainTypeId: null,
321+
wantedDestinationId: null,
317322
name: 'Without Train Type',
318323
createdAt: new Date('2025-01-04T00:00:00.000Z'),
319324
};
@@ -417,6 +422,7 @@ describe('useSavedRoutes', () => {
417422
hasTrainType: true,
418423
lineId: 300,
419424
trainTypeId: 10,
425+
wantedDestinationId: null,
420426
name: 'Route 1',
421427
createdAt: new Date('2025-01-05T00:00:00.000Z'),
422428
};
@@ -425,6 +431,7 @@ describe('useSavedRoutes', () => {
425431
hasTrainType: true,
426432
lineId: 300,
427433
trainTypeId: 20,
434+
wantedDestinationId: null,
428435
name: 'Route 2',
429436
createdAt: new Date('2025-01-06T00:00:00.000Z'),
430437
};
@@ -433,6 +440,7 @@ describe('useSavedRoutes', () => {
433440
hasTrainType: false,
434441
lineId: 300,
435442
trainTypeId: null,
443+
wantedDestinationId: null,
436444
name: 'Route 3 (no train type)',
437445
createdAt: new Date('2025-01-07T00:00:00.000Z'),
438446
};
@@ -480,6 +488,7 @@ describe('useSavedRoutes', () => {
480488
hasTrainType: true,
481489
lineId: 500, // JR神戸線のID
482490
trainTypeId: 50, // サンライズ出雲のgroupId
491+
wantedDestinationId: null,
483492
name: 'サンライズ出雲',
484493
createdAt: new Date('2025-01-08T00:00:00.000Z'),
485494
};

src/screens/SelectLineScreen.test.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ const createMockLoopItem = (
374374
name,
375375
lineId: id * 100,
376376
trainTypeId: null,
377+
wantedDestinationId: null,
377378
hasTrainType: false,
378379
createdAt: new Date('2024-01-01'),
379380
stations,

0 commit comments

Comments
 (0)