Skip to content

Commit ec02c48

Browse files
test(drive): assert the sibling-bound count's derived post
The descending-page test bound a like count to a limited sibling to show the sibling's limit applies before values derive, but only compared the materialized and verified results with each other. It now asserts the count covers exactly the sibling's single post, with the like count that post carries. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
1 parent d411dd3 commit ec02c48

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

packages/rs-drive/src/drive/contract/insert/insert_contract/v0/tests/composite_query_e2e_tests.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,16 @@ fn should_preserve_descending_documents_and_key_ordered_counts() {
707707
.expect("verifies");
708708
assert_eq!(verified.page_documents, materialized.page_documents);
709709
assert_eq!(verified.sub_results, materialized.sub_results);
710+
// The count bound to the sibling derived exactly the one post the
711+
// sibling's limit left it: A carries two likes, B one.
712+
let sibling_posts = post_ids_of(&verified.sub_results[2], "postId");
713+
assert_eq!(sibling_posts.len(), 1);
714+
let expected_likes = if sibling_posts[0] == POST_A { 2 } else { 1 };
715+
assert_eq!(
716+
counts(&verified.sub_results[3]),
717+
BTreeMap::from([(sibling_posts[0], expected_likes)]),
718+
"the sibling-bound count covers the sibling's single derived post"
719+
);
710720
}
711721

712722
/// The full round trip: the server's materialized result and the

0 commit comments

Comments
 (0)