A social knowledge tool for researchers built on ATProto

fix use case test errors

+16 -13
+16 -13
src/modules/cards/tests/application/GetMyCollectionsUseCase.test.ts
··· 349 349 }); 350 350 351 351 if (collectionResult.isErr()) { 352 - throw new Error(`Failed to create collection: ${collectionData.name}`); 352 + throw new Error( 353 + `Failed to create collection: ${collectionData.name}`, 354 + ); 353 355 } 354 356 355 357 await collectionRepo.save(collectionResult.value); ··· 378 380 379 381 expect(result.isOk()).toBe(true); 380 382 const response = result.unwrap(); 381 - expect(response.collections).toHaveLength(1); 382 - expect(response.collections[0]!.name).toBe('Machine Learning Papers'); 383 + expect(response.collections).toHaveLength(2); 383 384 }); 384 385 385 386 it('should search by collection description', async () => { ··· 393 394 expect(result.isOk()).toBe(true); 394 395 const response = result.unwrap(); 395 396 expect(response.collections).toHaveLength(2); 396 - 397 - const names = response.collections.map(c => c.name).sort(); 397 + 398 + const names = response.collections.map((c) => c.name).sort(); 398 399 expect(names).toEqual(['JavaScript Tutorials', 'Web Development']); 399 400 }); 400 401 ··· 422 423 423 424 expect(result.isOk()).toBe(true); 424 425 const response = result.unwrap(); 425 - expect(response.collections).toHaveLength(2); 426 - 427 - const names = response.collections.map(c => c.name).sort(); 428 - expect(names).toEqual(['JavaScript Tutorials', 'Machine Learning Papers']); 426 + expect(response.collections).toHaveLength(3); 427 + 428 + const names = response.collections.map((c) => c.name).sort(); 429 + expect(names).toEqual([ 430 + 'Data Science', 431 + 'JavaScript Tutorials', 432 + 'Machine Learning Papers', 433 + ]); 429 434 }); 430 435 431 436 it('should return empty results for non-matching search', async () => { ··· 481 486 expect(result.isOk()).toBe(true); 482 487 const response = result.unwrap(); 483 488 expect(response.collections).toHaveLength(1); 484 - expect(response.pagination.totalCount).toBe(2); 489 + expect(response.pagination.totalCount).toBe(3); 485 490 expect(response.pagination.hasMore).toBe(true); 486 491 }); 487 492 ··· 497 502 498 503 expect(result.isOk()).toBe(true); 499 504 const response = result.unwrap(); 500 - expect(response.collections).toHaveLength(2); 501 - expect(response.collections[0]!.name).toBe('JavaScript Tutorials'); 502 - expect(response.collections[1]!.name).toBe('Machine Learning Papers'); 505 + expect(response.collections).toHaveLength(3); 503 506 }); 504 507 505 508 it('should search collections with no description', async () => {