summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/commands/restoreCommand.test.ts
diff options
context:
space:
mode:
authorYuki Okita <[email protected]>2025-08-20 10:55:47 +0900
committerGitHub <[email protected]>2025-08-20 01:55:47 +0000
commit21c6480b65528a98ac0e1e3855f3c78c1f9b7cbe (patch)
tree5555ec429209e87e0c21483c9e5fddd53ac01dbc /packages/cli/src/ui/commands/restoreCommand.test.ts
parent1049d388451120587a8643a401fd71430a8cd5fe (diff)
Refac: Centralize storage file management (#4078)
Co-authored-by: Taylor Mullen <[email protected]>
Diffstat (limited to 'packages/cli/src/ui/commands/restoreCommand.test.ts')
-rw-r--r--packages/cli/src/ui/commands/restoreCommand.test.ts11
1 files changed, 8 insertions, 3 deletions
diff --git a/packages/cli/src/ui/commands/restoreCommand.test.ts b/packages/cli/src/ui/commands/restoreCommand.test.ts
index 23f71499..b9ecc139 100644
--- a/packages/cli/src/ui/commands/restoreCommand.test.ts
+++ b/packages/cli/src/ui/commands/restoreCommand.test.ts
@@ -39,7 +39,10 @@ describe('restoreCommand', () => {
mockConfig = {
getCheckpointingEnabled: vi.fn().mockReturnValue(true),
- getProjectTempDir: vi.fn().mockReturnValue(geminiTempDir),
+ storage: {
+ getProjectTempCheckpointsDir: vi.fn().mockReturnValue(checkpointsDir),
+ getProjectTempDir: vi.fn().mockReturnValue(geminiTempDir),
+ },
getGeminiClient: vi.fn().mockReturnValue({
setHistory: mockSetHistory,
}),
@@ -77,7 +80,9 @@ describe('restoreCommand', () => {
describe('action', () => {
it('should return an error if temp dir is not found', async () => {
- vi.mocked(mockConfig.getProjectTempDir).mockReturnValue('');
+ vi.mocked(
+ mockConfig.storage.getProjectTempCheckpointsDir,
+ ).mockReturnValue('');
expect(
await restoreCommand(mockConfig)?.action?.(mockContext, ''),
@@ -219,7 +224,7 @@ describe('restoreCommand', () => {
describe('completion', () => {
it('should return an empty array if temp dir is not found', async () => {
- vi.mocked(mockConfig.getProjectTempDir).mockReturnValue('');
+ vi.mocked(mockConfig.storage.getProjectTempDir).mockReturnValue('');
const command = restoreCommand(mockConfig);
expect(await command?.completion?.(mockContext, '')).toEqual([]);