Repository navigation
Test NavigationDump - #4739
Merged
Merged
Test NavigationDump#4739
Conversation
The review of #4719 pointed out that NavigationDump.ToText was the one shared helper without a test, and that Navigation.Tests snapshots its output, so a bug in it would be accepted into every one of those snapshots without anyone noticing. A broken [wrong parent] check would hide the regression it exists to catch. Three inline-snapshot tests over small fake navigation types: the index page is listed first and the children follow, indented by depth, with [hidden] and [island] and generic type names trimmed; a child whose Parent is another node is flagged [wrong parent]; an index page whose parent differs is not. Each of seven mutations of NavigationDump (no indentation, no wrong-parent flag, no hidden flag, no island flag, untrimmed generic names, index listed last, index checked for its parent) makes at least one of them fail. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
Docs preview (local build)Handbook preview: https://docs-v3-preview.elastic.dev/elastic/docs-builder/pull/4739/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to a review comment on #4719: #4719 (comment)
NavigationDump.ToTextwas the one shared test helper without a test. Navigation.Tests snapshots its output, so a bug in it would be accepted into every one of those snapshots, and a broken[wrong parent]check would hide the regression it exists to catch.Three inline-snapshot tests over small fake navigation types:
[hidden]and[island]flags and generic type names trimmed;Parentis another node is flagged[wrong parent];Checked
Elastic.Documentation.Testspasses (56 tests).NavigationDumpseven ways: no indentation, a[wrong parent]check that is never true, no[hidden]flag, no[island]flag, untrimmed generic type names, the index listed last, and the index checked for its parent. Each makes at least one test fail, and the wrong-parent mutation fails the test written for it.🤖 Generated with Claude Code