🧹 Simplify test code by condensing multi-line statements into single lines where applicable
This commit is contained in:
@@ -73,9 +73,7 @@ describe('useGamemasterFiles', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should set error on fetch failure', async () => {
|
it('should set error on fetch failure', async () => {
|
||||||
mockClient.getStatus.mockRejectedValueOnce(
|
mockClient.getStatus.mockRejectedValueOnce(new Error('Network error'));
|
||||||
new Error('Network error')
|
|
||||||
);
|
|
||||||
await composable.loadStatus();
|
await composable.loadStatus();
|
||||||
expect(composable.fileError.value).toBe('Network error');
|
expect(composable.fileError.value).toBe('Network error');
|
||||||
});
|
});
|
||||||
@@ -200,9 +198,7 @@ describe('useGamemasterFiles', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should set error on load failure', async () => {
|
it('should set error on load failure', async () => {
|
||||||
mockClient.getPokemon.mockRejectedValueOnce(
|
mockClient.getPokemon.mockRejectedValueOnce(new Error('Load failed'));
|
||||||
new Error('Load failed')
|
|
||||||
);
|
|
||||||
composable.selectedFile.value = 'pokemon';
|
composable.selectedFile.value = 'pokemon';
|
||||||
|
|
||||||
await composable.loadFile();
|
await composable.loadFile();
|
||||||
@@ -284,9 +280,7 @@ describe('useGamemasterFiles', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should format raw file name', () => {
|
it('should format raw file name', () => {
|
||||||
expect(composable.formatFileName('raw.json')).toBe(
|
expect(composable.formatFileName('raw.json')).toBe('Raw Gamemaster');
|
||||||
'Raw Gamemaster'
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user