Skip to content

Test NavigationDump - #4739

Merged
Mpdreamz merged 1 commit into
mainfrom
test/navigationdump-test
Nov 5, 2026
Merged

Mpdreamz merged 1 commit into
mainfrom
test/navigationdump-test

Conversation

@Mpdreamz

@Mpdreamz Mpdreamz commented Nov 5, 2026

Copy link
Copy Markdown
Member

Follow-up to a review comment on #4719: #4719 (comment)

NavigationDump.ToText was 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:

  • the index page is listed first and the children follow, indented by depth, with [hidden] and [island] flags and generic type names trimmed;
  • a child whose Parent is another node is flagged [wrong parent];
  • an index page whose parent differs from its node is not flagged (a virtual file's index has a different parent).

Checked

  • Elastic.Documentation.Tests passes (56 tests).
  • I mutated NavigationDump seven 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

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>
@Mpdreamz
Mpdreamz requested a review from a team as a code owner November 5, 2026 15:01
@Mpdreamz
Mpdreamz requested a review from theletterf November 5, 2026 15:01
@Mpdreamz Mpdreamz added the chore label Nov 5, 2026
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Docs preview (local build)

Handbook preview: https://docs-v3-preview.elastic.dev/elastic/docs-builder/pull/4739/

@Mpdreamz
Mpdreamz merged commit 002b9ca into main Nov 5, 2026
41 of 42 checks passed
@Mpdreamz
Mpdreamz deleted the test/navigationdump-test branch November 5, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant