Repository navigation
Snapshot the authorization section tests - #4686
Merged
Merged
Conversation
Three tests in `AuthorizationSectionRenderingTests` checked the same rendered block with 21 `Contain`/`NotContain` assertions. Each now compares against a verified HTML snapshot, plus one targeted assertion that states its intent. The four small tests stay as they are. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
reakaleek
approved these changes
Nov 4, 2026
akira28
enabled auto-merge (squash)
November 4, 2026 15:58
Contributor
Docs preview (local build)Handbook preview: https://docs-v3-preview.elastic.dev/elastic/docs-builder/pull/4686/ |
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.
Three
AuthorizationSectionRenderingTestsnow compare the rendered block against a verified HTML snapshot instead of 21Contain/NotContainassertions.Affects: Internals only
Prompt summary: Continue the test-growth reduction by converting the next ApiExplorer rendering tests to snapshots, as a separate PR after the responses block (#4684).
Why
The three tests assert on the same rendered block with many string checks. Each new markup detail adds another line, and a reviewer cannot see the whole block at once.
What
Snapshots replace string checks
Render_RequirementWithTwoSchemes_SharesOneTabAndSaysToSendBoth,Render_OneRequirementWithTwoSchemes_HasNoTabsAndShowsBothSchemesandRender_PrivilegesNeededTogether_AreSummarisedAsSeparateNamesJoinedWithPluscallMatchHtmlSnapshot(). The snapshots are 53, 39 and 29 lines under.snapshots/AuthorizationSectionRenderingTests/.Intent assertions stay
One
ContainorNotContainper test keeps the reason visible, such as "a single requirement needs no tabs". The four small tests are unchanged.Verify
All 21 removed assertions hold on the new output. Renaming the tab label class, turning the scheme
<h3>into<h4>and changing the summary item markup each fail the converted tests.🤖 Generated with Claude Code