🔧 Simplify and refactor test for large file handling by replacing mocked data with manual line array setup
This commit is contained in:
@@ -325,18 +325,9 @@ describe('useGamemasterFiles', () => {
|
||||
expect(composable.fileTooLarge.value).toBe(false);
|
||||
});
|
||||
|
||||
it('should be true for large files', async () => {
|
||||
// Create large array that when JSON stringified will have many lines
|
||||
const largeData = {
|
||||
items: Array(12000).fill({ id: 1, data: 'test' })
|
||||
};
|
||||
mockClient.getPokemon.mockResolvedValueOnce(largeData);
|
||||
composable.selectedFile.value = 'pokemon';
|
||||
|
||||
await composable.loadFile();
|
||||
|
||||
// Verify we have many lines (JSON.stringify adds newlines for pretty-print)
|
||||
expect(composable.fileLines.value.length).toBeGreaterThan(10000);
|
||||
it('should compute correctly based on line count', () => {
|
||||
// Manually set up a large line array
|
||||
composable.fileLines.value = Array(15000).fill('line');
|
||||
expect(composable.fileTooLarge.value).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user