diff --git a/code/websites/pokedex.online/tests/unit/composables/useGamemasterFiles.test.js b/code/websites/pokedex.online/tests/unit/composables/useGamemasterFiles.test.js index f88e3d3..e11faad 100644 --- a/code/websites/pokedex.online/tests/unit/composables/useGamemasterFiles.test.js +++ b/code/websites/pokedex.online/tests/unit/composables/useGamemasterFiles.test.js @@ -192,8 +192,14 @@ describe('useGamemasterFiles', () => { }); it('should set error on load failure', async () => { - mockClient.getMoves.mockRejectedValueOnce(new Error('Load failed')); + // First, set up status so we have available files + mockClient.getStatus.mockResolvedValueOnce({ + available: [{ filename: 'moves.json', size: 3000 }] + }); await composable.loadStatus(); + + // Now set up the getMoves to fail + mockClient.getMoves.mockRejectedValueOnce(new Error('Load failed')); composable.selectedFile.value = 'moves'; await composable.loadFile();