Commit 6d80390
committed
test: add getCollection mocks to upsertPoints and search tests
Fixed 12 more test failures by adding missing getCollection mocks:
upsertPoints tests (5 fixed):
- should correctly call qdrantClient.upsert with processed points
- should handle points without filePath in payload
- should handle empty input arrays
- should correctly process pathSegments for nested file paths
- should handle error scenarios when qdrantClient.upsert fails
search tests (7 fixed):
- should correctly call qdrantClient.query and transform results
- should apply filePathPrefix filter correctly
- should use custom minScore when provided
- should use custom maxResults when provided
- should filter out results with invalid payloads
- should filter out results with null or undefined payloads
- should handle scenarios where no results are found
All these methods now call getCollectionInfo() internally which requires getCollection() to be mocked.
Remaining: 10 initialize/collectionExists tests need complex mock sequences1 parent ad01b30 commit 6d80390
File tree
1 file changed
+12
-0
lines changed- src/services/code-index/vector-store/__tests__
1 file changed
+12
-0
lines changedLines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1071 | 1071 | | |
1072 | 1072 | | |
1073 | 1073 | | |
| 1074 | + | |
1074 | 1075 | | |
1075 | 1076 | | |
1076 | 1077 | | |
| |||
1126 | 1127 | | |
1127 | 1128 | | |
1128 | 1129 | | |
| 1130 | + | |
1129 | 1131 | | |
1130 | 1132 | | |
1131 | 1133 | | |
| |||
1147 | 1149 | | |
1148 | 1150 | | |
1149 | 1151 | | |
| 1152 | + | |
1150 | 1153 | | |
1151 | 1154 | | |
1152 | 1155 | | |
| |||
1171 | 1174 | | |
1172 | 1175 | | |
1173 | 1176 | | |
| 1177 | + | |
1174 | 1178 | | |
1175 | 1179 | | |
1176 | 1180 | | |
| |||
1214 | 1218 | | |
1215 | 1219 | | |
1216 | 1220 | | |
| 1221 | + | |
1217 | 1222 | | |
1218 | 1223 | | |
1219 | 1224 | | |
| |||
1255 | 1260 | | |
1256 | 1261 | | |
1257 | 1262 | | |
| 1263 | + | |
1258 | 1264 | | |
1259 | 1265 | | |
1260 | 1266 | | |
| |||
1296 | 1302 | | |
1297 | 1303 | | |
1298 | 1304 | | |
| 1305 | + | |
1299 | 1306 | | |
1300 | 1307 | | |
1301 | 1308 | | |
| |||
1333 | 1340 | | |
1334 | 1341 | | |
1335 | 1342 | | |
| 1343 | + | |
1336 | 1344 | | |
1337 | 1345 | | |
1338 | 1346 | | |
| |||
1357 | 1365 | | |
1358 | 1366 | | |
1359 | 1367 | | |
| 1368 | + | |
1360 | 1369 | | |
1361 | 1370 | | |
1362 | 1371 | | |
| |||
1411 | 1420 | | |
1412 | 1421 | | |
1413 | 1422 | | |
| 1423 | + | |
1414 | 1424 | | |
1415 | 1425 | | |
1416 | 1426 | | |
| |||
1458 | 1468 | | |
1459 | 1469 | | |
1460 | 1470 | | |
| 1471 | + | |
1461 | 1472 | | |
1462 | 1473 | | |
1463 | 1474 | | |
| |||
1472 | 1483 | | |
1473 | 1484 | | |
1474 | 1485 | | |
| 1486 | + | |
1475 | 1487 | | |
1476 | 1488 | | |
1477 | 1489 | | |
| |||
0 commit comments