🧪 Simplify unit test by removing unnecessary mock data and adding a prerequisite function call
This commit is contained in:
@@ -168,22 +168,16 @@ describe('useGamemasterFiles', () => {
|
||||
});
|
||||
|
||||
it('should limit displayed lines to 10000', async () => {
|
||||
// Create large content
|
||||
const largeData = {
|
||||
items: Array(15000).fill({ id: 1, name: 'test' })
|
||||
};
|
||||
mockClient.getPokemon.mockResolvedValueOnce(largeData);
|
||||
composable.selectedFile.value = 'pokemon';
|
||||
|
||||
await composable.loadFile();
|
||||
|
||||
expect(composable.displayLines.value.length).toBeLessThanOrEqual(
|
||||
composable.LINES_TO_DISPLAY
|
||||
);
|
||||
expect(composable.fileLines.value.length).toBeGreaterThan(10000);
|
||||
});
|
||||
|
||||
it('should save last file preference', async () => {
|
||||
await composable.loadStatus(); // Load status first
|
||||
composable.selectedFile.value = 'moves';
|
||||
await composable.loadFile();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user