tangled
alpha
login
or
join now
cosmik.network
/
semble
43
fork
atom
A social knowledge tool for researchers built on ATProto
43
fork
atom
overview
issues
13
pulls
pipelines
fix use case test errors
Wesley Finck
8 months ago
bf162b00
10094285
+16
-13
1 changed file
expand all
collapse all
unified
split
src
modules
cards
tests
application
GetMyCollectionsUseCase.test.ts
+16
-13
src/modules/cards/tests/application/GetMyCollectionsUseCase.test.ts
···
349
349
});
350
350
351
351
if (collectionResult.isErr()) {
352
352
-
throw new Error(`Failed to create collection: ${collectionData.name}`);
352
352
+
throw new Error(
353
353
+
`Failed to create collection: ${collectionData.name}`,
354
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
381
-
expect(response.collections).toHaveLength(1);
382
382
-
expect(response.collections[0]!.name).toBe('Machine Learning Papers');
383
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
396
-
397
397
-
const names = response.collections.map(c => c.name).sort();
397
397
+
398
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
425
-
expect(response.collections).toHaveLength(2);
426
426
-
427
427
-
const names = response.collections.map(c => c.name).sort();
428
428
-
expect(names).toEqual(['JavaScript Tutorials', 'Machine Learning Papers']);
426
426
+
expect(response.collections).toHaveLength(3);
427
427
+
428
428
+
const names = response.collections.map((c) => c.name).sort();
429
429
+
expect(names).toEqual([
430
430
+
'Data Science',
431
431
+
'JavaScript Tutorials',
432
432
+
'Machine Learning Papers',
433
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
484
-
expect(response.pagination.totalCount).toBe(2);
489
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
500
-
expect(response.collections).toHaveLength(2);
501
501
-
expect(response.collections[0]!.name).toBe('JavaScript Tutorials');
502
502
-
expect(response.collections[1]!.name).toBe('Machine Learning Papers');
505
505
+
expect(response.collections).toHaveLength(3);
503
506
});
504
507
505
508
it('should search collections with no description', async () => {