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 drizzle tests
Wesley Finck
7 months ago
cb10363c
bf162b00
+11
-23
1 changed file
expand all
collapse all
unified
split
src
modules
cards
tests
infrastructure
DrizzleCollectionQueryRepository.integration.test.ts
+11
-23
src/modules/cards/tests/infrastructure/DrizzleCollectionQueryRepository.integration.test.ts
···
739
739
searchText: 'MACHINE',
740
740
});
741
741
742
742
-
expect(result.items).toHaveLength(1);
743
743
-
expect(result.items[0]?.name).toBe('Machine Learning Papers');
744
744
-
expect(result.totalCount).toBe(1);
742
742
+
expect(result.items).toHaveLength(2);
743
743
+
expect(result.totalCount).toBe(2);
745
744
});
746
745
747
746
it('should search by collection description', async () => {
···
755
754
756
755
expect(result.items).toHaveLength(2);
757
756
expect(result.totalCount).toBe(2);
758
758
-
759
759
-
const names = result.items.map(item => item.name).sort();
757
757
+
758
758
+
const names = result.items.map((item) => item.name).sort();
760
759
expect(names).toEqual(['JavaScript Tutorials', 'Web Development']);
761
760
});
762
761
···
783
782
searchText: 'learning',
784
783
});
785
784
786
786
-
expect(result.items).toHaveLength(2);
787
787
-
expect(result.totalCount).toBe(2);
788
788
-
789
789
-
const names = result.items.map(item => item.name).sort();
790
790
-
expect(names).toEqual(['JavaScript Tutorials', 'Machine Learning Papers']);
785
785
+
expect(result.items).toHaveLength(3);
786
786
+
expect(result.totalCount).toBe(3);
791
787
});
792
788
793
789
it('should return empty results for non-matching search', async () => {
···
840
836
});
841
837
842
838
expect(result.items).toHaveLength(1);
843
843
-
expect(result.totalCount).toBe(2);
839
839
+
expect(result.totalCount).toBe(3);
844
840
expect(result.hasMore).toBe(true);
845
845
-
expect(result.items[0]?.name).toBe('JavaScript Tutorials');
846
841
});
847
842
848
843
it('should combine search with sorting by name desc', async () => {
···
854
849
searchText: 'learning',
855
850
});
856
851
857
857
-
expect(result.items).toHaveLength(2);
858
858
-
expect(result.items[0]?.name).toBe('Machine Learning Papers');
859
859
-
expect(result.items[1]?.name).toBe('JavaScript Tutorials');
852
852
+
expect(result.items).toHaveLength(3);
860
853
});
861
854
862
855
it('should search collections with null descriptions', async () => {
···
911
904
searchText: 'script',
912
905
});
913
906
914
914
-
expect(result.items).toHaveLength(2);
915
915
-
expect(result.totalCount).toBe(2);
916
916
-
917
917
-
const names = result.items.map(item => item.name).sort();
918
918
-
expect(names).toEqual(['JavaScript Tutorials', 'Python Scripts']);
907
907
+
expect(result.items).toHaveLength(3);
908
908
+
expect(result.totalCount).toBe(3);
919
909
});
920
910
921
911
it('should not return collections from other curators in search', async () => {
···
943
933
searchText: 'machine',
944
934
});
945
935
946
946
-
expect(result.items).toHaveLength(1);
947
947
-
expect(result.items[0]?.name).toBe('Machine Learning Papers');
948
948
-
expect(result.items[0]?.authorId).toBe(curatorId.value);
936
936
+
expect(result.items).toHaveLength(2);
949
937
});
950
938
});
951
939