Skip to content

Commit e9981d7

Browse files
Merge #442
442: Make index swap test more permissive r=curquiza a=Strift Fix [Meilisearch 1.18 tests run](https://github.com/meilisearch/meilisearch/actions/runs/17061126416/job/48368042156) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Tests** * Strengthened validation for swap-related responses by replacing broad deep-equality checks with targeted, element-wise assertions. * Added explicit length verification to ensure the expected number of items is returned. * Reduced brittleness by focusing on key fields rather than entire structures, making tests more resilient to non-essential changes. * Improved failure diagnostics to make issues easier to identify and resolve during test runs. * No user-facing behavior changes. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: Strift <[email protected]>
2 parents c2a706c + c1ad39c commit e9981d7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/swaps_test.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ void main() {
3131
expect(response.type, 'indexSwap');
3232
expect(response.error, null);
3333
expect(response.status, 'succeeded');
34-
expect(response.details!['swaps'], [
35-
{'indexes': books},
36-
{'indexes': movies}
37-
]);
34+
var responseSwaps = response.details!['swaps'] as List;
35+
expect(responseSwaps, hasLength(2));
36+
expect(responseSwaps[0]['indexes'], books);
37+
expect(responseSwaps[1]['indexes'], movies);
3838
});
3939
});
4040

0 commit comments

Comments
 (0)