Skip to content

Commit 1bc6944

Browse files
committed
test: address PR review feedback for test
improvements - Remove unnecessary .not.toThrow() assertion in useManagerQueue test - Add clarifying comments for version normalization test logic - Replace 'as any' with vi.mocked() for better type safety
1 parent 5f17778 commit 1bc6944

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

tests-ui/tests/composables/useManagerQueue.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,8 @@ describe('useManagerQueue', () => {
197197
ver: '2.0.0'
198198
})
199199

200-
// Version suffixed keys should not exist
200+
// Version suffixed keys should not exist after normalization
201+
// The pack should be accessible by its base name only (without @version)
201202
expect(installedPacks.value['ComfyUI-GGUF@1_1_4']).toBeUndefined()
202203
})
203204

@@ -211,8 +212,8 @@ describe('useManagerQueue', () => {
211212
installed_packs: undefined
212213
}
213214

214-
// Should not throw
215-
expect(() => queue.updateTaskState(mockState)).not.toThrow()
215+
// Just call the function - if it throws, the test will fail automatically
216+
queue.updateTaskState(mockState)
216217

217218
// installedPacks should remain unchanged
218219
expect(installedPacks.value).toEqual({})

tests-ui/tests/store/comfyManagerStore.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ describe('useComfyManagerStore', () => {
457457
}
458458
}
459459

460-
;(mockManagerService.listInstalledPacks as any).mockResolvedValue(
460+
vi.mocked(mockManagerService.listInstalledPacks).mockResolvedValue(
461461
mockPacks
462462
)
463463

@@ -498,7 +498,7 @@ describe('useComfyManagerStore', () => {
498498
}
499499
}
500500

501-
;(mockManagerService.listInstalledPacks as any).mockResolvedValue(
501+
vi.mocked(mockManagerService.listInstalledPacks).mockResolvedValue(
502502
mockPacks
503503
)
504504

@@ -520,7 +520,7 @@ describe('useComfyManagerStore', () => {
520520
}
521521
}
522522

523-
;(mockManagerService.listInstalledPacks as any).mockResolvedValue(
523+
vi.mocked(mockManagerService.listInstalledPacks).mockResolvedValue(
524524
mockPacks
525525
)
526526

0 commit comments

Comments
 (0)