style: fix linting issues met Prettier
This commit is contained in:
		
							parent
							
								
									db582ee46a
								
							
						
					
					
						commit
						09bf765e8c
					
				
					 1 changed files with 28 additions and 33 deletions
				
			
		|  | @ -1,13 +1,8 @@ | |||
| import { describe, it, expect, vi } from 'vitest'; | ||||
| import { | ||||
|     LearningObjectMetadata, LearningPath, | ||||
| } from "../../src/interfaces/learningPath"; | ||||
| import {fetchWithLogging} from "../../src/util/apiHelper"; | ||||
| import { | ||||
|     getLearningObjectById, | ||||
|     getLearningObjectsFromPath | ||||
| } from "../../src/services/learningObjects"; | ||||
| import {fetchLearningPaths} from "../../src/services/learningPaths"; | ||||
| import { LearningObjectMetadata, LearningPath } from '../../src/interfaces/learningPath'; | ||||
| import { fetchWithLogging } from '../../src/util/apiHelper'; | ||||
| import { getLearningObjectById, getLearningObjectsFromPath } from '../../src/services/learningObjects'; | ||||
| import { fetchLearningPaths } from '../../src/services/learningPaths'; | ||||
| 
 | ||||
| // Mock API functions
 | ||||
| vi.mock('../../src/util/apiHelper', () => ({ | ||||
|  | @ -18,7 +13,6 @@ vi.mock('../../src/services/learningPaths', () => ({ | |||
|     fetchLearningPaths: vi.fn(), | ||||
| })); | ||||
| 
 | ||||
| 
 | ||||
| describe('getLearningObjectById', () => { | ||||
|     const hruid = 'test-object'; | ||||
|     const language = 'en'; | ||||
|  | @ -38,7 +32,7 @@ describe('getLearningObjectById', () => { | |||
|         description: 'A test object', | ||||
|         target_ages: [10, 12], | ||||
|         content_type: 'markdown', | ||||
|         content_location: '' | ||||
|         content_location: '', | ||||
|     }; | ||||
| 
 | ||||
|     it('✅ Should return a filtered learning object when API provides data', async () => { | ||||
|  | @ -63,7 +57,7 @@ describe('getLearningObjectById', () => { | |||
|             description: 'A test object', | ||||
|             targetAges: [10, 12], | ||||
|             contentType: 'markdown', | ||||
|             contentLocation: '' | ||||
|             contentLocation: '', | ||||
|         }); | ||||
|     }); | ||||
| 
 | ||||
|  | @ -74,13 +68,13 @@ describe('getLearningObjectById', () => { | |||
|     }); | ||||
| }); | ||||
| 
 | ||||
| 
 | ||||
| describe('getLearningObjectsFromPath', () => { | ||||
|     const hruid = 'test-path'; | ||||
|     const language = 'en'; | ||||
| 
 | ||||
|     it('✅ Should not give error or warning', async () => { | ||||
|         const mockPathResponse: LearningPath[] = [{ | ||||
|         const mockPathResponse: LearningPath[] = [ | ||||
|             { | ||||
|                 _id: 'path-1', | ||||
|                 hruid, | ||||
|                 language, | ||||
|  | @ -94,12 +88,13 @@ describe('getLearningObjectsFromPath', () => { | |||
|                 min_age: 10, | ||||
|                 max_age: 12, | ||||
|                 __order: 1, | ||||
|         }]; | ||||
|             }, | ||||
|         ]; | ||||
| 
 | ||||
|         vi.mocked(fetchLearningPaths).mockResolvedValueOnce({ | ||||
|             success: true, | ||||
|             source: 'Test Source', | ||||
|             data: mockPathResponse | ||||
|             data: mockPathResponse, | ||||
|         }); | ||||
| 
 | ||||
|         const result = await getLearningObjectsFromPath(hruid, language); | ||||
|  |  | |||
		Reference in a new issue
	
	 Lint Action
						Lint Action