alpha
Login
or
Join now
nandi.uk
/
semble
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
This repository has no description
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
remove unecessary and failing test
author
Wesley Finck
date
4 months ago
(Mar 9, 2026, 3:55 PM -0700)
commit
db7b4d3e
db7b4d3e2664abd1336091eccffd08120a31d179
parent
74461451
744614511187f6d32ecd37042a41270f622d35f5
-94
1 changed file
Expand all
Collapse all
Unified
Split
src
modules
cards
tests
infrastructure
DrizzleCardQueryRepository.searchUrls.integration.test.ts
-94
src/modules/cards/tests/infrastructure/DrizzleCardQueryRepository.searchUrls.integration.test.ts
View file
Reviewed
···
397
397
});
398
398
});
399
399
400
400
-
describe('Sorting', () => {
401
401
-
it('should sort by updated date descending', async () => {
402
402
-
const url1 = URL.create('https://example.com/old').unwrap();
403
403
-
const metadata1 = UrlMetadata.create({
404
404
-
url: url1.value,
405
405
-
title: 'Old Article',
406
406
-
description: 'Test',
407
407
-
}).unwrap();
408
408
-
409
409
-
const url2 = URL.create('https://example.com/new').unwrap();
410
410
-
const metadata2 = UrlMetadata.create({
411
411
-
url: url2.value,
412
412
-
title: 'New Article',
413
413
-
description: 'Test',
414
414
-
}).unwrap();
415
415
-
416
416
-
const card1 = new CardBuilder()
417
417
-
.withCuratorId(curator1.value)
418
418
-
.withUrlCard(url1, metadata1)
419
419
-
.withUpdatedAt(new Date('2023-01-01'))
420
420
-
.buildOrThrow();
421
421
-
422
422
-
const card2 = new CardBuilder()
423
423
-
.withCuratorId(curator1.value)
424
424
-
.withUrlCard(url2, metadata2)
425
425
-
.withUpdatedAt(new Date('2023-01-02'))
426
426
-
.buildOrThrow();
427
427
-
428
428
-
card1.addToLibrary(curator1);
429
429
-
card2.addToLibrary(curator1);
430
430
-
431
431
-
await cardRepository.save(card1);
432
432
-
await cardRepository.save(card2);
433
433
-
434
434
-
const result = await queryRepository.searchUrls({
435
435
-
searchQuery: 'article',
436
436
-
page: 1,
437
437
-
limit: 10,
438
438
-
sortBy: CardSortField.UPDATED_AT,
439
439
-
sortOrder: SortOrder.DESC,
440
440
-
});
441
441
-
442
442
-
expect(result.items).toHaveLength(2);
443
443
-
expect(result.items[0]!.url).toBe(url2.value); // Newer first
444
444
-
expect(result.items[1]!.url).toBe(url1.value);
445
445
-
});
446
446
-
447
447
-
it('should sort by updated date ascending', async () => {
448
448
-
const url1 = URL.create('https://example.com/old').unwrap();
449
449
-
const metadata1 = UrlMetadata.create({
450
450
-
url: url1.value,
451
451
-
title: 'Old Article',
452
452
-
description: 'Test',
453
453
-
}).unwrap();
454
454
-
455
455
-
const url2 = URL.create('https://example.com/new').unwrap();
456
456
-
const metadata2 = UrlMetadata.create({
457
457
-
url: url2.value,
458
458
-
title: 'New Article',
459
459
-
description: 'Test',
460
460
-
}).unwrap();
461
461
-
462
462
-
const card1 = new CardBuilder()
463
463
-
.withCuratorId(curator1.value)
464
464
-
.withUrlCard(url1, metadata1)
465
465
-
.withUpdatedAt(new Date('2023-01-01'))
466
466
-
.buildOrThrow();
467
467
-
468
468
-
const card2 = new CardBuilder()
469
469
-
.withCuratorId(curator1.value)
470
470
-
.withUrlCard(url2, metadata2)
471
471
-
.withUpdatedAt(new Date('2023-01-02'))
472
472
-
.buildOrThrow();
473
473
-
474
474
-
card1.addToLibrary(curator1);
475
475
-
card2.addToLibrary(curator1);
476
476
-
477
477
-
await cardRepository.save(card1);
478
478
-
await cardRepository.save(card2);
479
479
-
480
480
-
const result = await queryRepository.searchUrls({
481
481
-
searchQuery: 'article',
482
482
-
page: 1,
483
483
-
limit: 10,
484
484
-
sortBy: CardSortField.UPDATED_AT,
485
485
-
sortOrder: SortOrder.ASC,
486
486
-
});
487
487
-
488
488
-
expect(result.items).toHaveLength(2);
489
489
-
expect(result.items[0]!.url).toBe(url1.value); // Older first
490
490
-
expect(result.items[1]!.url).toBe(url2.value);
491
491
-
});
492
492
-
});
493
493
-
494
400
describe('Pagination', () => {
495
401
it('should paginate results correctly', async () => {
496
402
// Create 5 cards