Skip to content

Reduce exact rank assertions in ordering tests#4237

Open
marcus-pousette wants to merge 3 commits into
cybersemics:mainfrom
Antonov548:issue-4236-rank-order-tests
Open

Reduce exact rank assertions in ordering tests#4237
marcus-pousette wants to merge 3 commits into
cybersemics:mainfrom
Antonov548:issue-4236-rank-order-tests

Conversation

@marcus-pousette
Copy link
Copy Markdown

@marcus-pousette marcus-pousette commented May 7, 2026

Closes #4236.

This is a test-only pass that makes higher-level ordering tests assert ordered thought values instead of exact numeric rank values where the rank number is not the behavior under test.

Changes:

  • Add expectThoughtValues for readable ordered thought assertions.
  • Replace exact rank expectations in cursor/path/order behavior tests.
  • Leave rank-specific expectations in tests that are directly checking rank calculation, rank preservation, or rank normalization.

@marcus-pousette marcus-pousette force-pushed the issue-4236-rank-order-tests branch from a33174a to 026dfbd Compare May 7, 2026 08:10
Comment thread src/test-helpers/expectThoughtValuesInOrder.ts Outdated
Comment thread src/test-helpers/expectThoughtValuesInOrder.ts Outdated
Comment thread src/selectors/__tests__/getDescendantThoughtIds.ts
@raineorshine
Copy link
Copy Markdown
Contributor

Hi, thanks for creating this.

A few initial comments above.

@marcus-pousette marcus-pousette marked this pull request as ready for review May 13, 2026 20:50
@marcus-pousette
Copy link
Copy Markdown
Author

@raineorshine Thanks for the review. See my latest commit a751028. I hope this aligns with what you had in mind.

Copy link
Copy Markdown
Contributor

@raineorshine raineorshine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This looks better. The existing expectPathToEqual is a good idea for cursor assertions.

Comment thread src/selectors/__tests__/getDescendantThoughtIds.ts Outdated
Comment thread src/selectors/__tests__/getDescendantThoughtIds.ts Outdated
Comment thread src/selectors/__tests__/getDescendantThoughtIds.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reduce exact rank assertions in ordering tests ahead of TreeCRDT integration

2 participants