Skip to content

Snapshot operation parameter sections, not the whole page - #4687

Merged
akira28 merged 2 commits into
mainfrom
test/operation-partial-snapshots
Nov 4, 2026
Merged

akira28 merged 2 commits into
mainfrom
test/operation-partial-snapshots

Conversation

@akira28

@akira28 akira28 commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

OperationHeadingLevelTests now snapshots the path parameters, query parameters and request body sections separately instead of the whole operation page, and AGENTS.md documents how to write HTML snapshots.

Affects: Internals only

Prompt summary: Follow up on the first snapshot pilot, which still compared a very large page, by snapshotting smaller components instead. Document the snapshot workflow so contributors can repeat it.

Why

The pilot snapshot in OperationHeadingLevelTests covers 896 lines of one page. An unrelated change, such as the popover text in #4311, already broke it once. A reviewer also cannot tell which part of the page a diff concerns.

What

One snapshot per section

The heading outline test keeps its check of one h1, then h2 sections and a nested h3. Three new tests snapshot #path-params-list, #query-params-list and #request-body-list, 416 lines in total. The authentication and responses blocks already have their own partial snapshots in #4684 and #4686.

Snapshot guidance

AGENTS.md (the target of CLAUDE.md) now explains when to use a snapshot, how to narrow it, how to accept new files with SNAPSHOT_ACCEPT=1, and to run a mutation check before committing.

Verify

dotnet test --project tests/Elastic.ApiExplorer.Tests --treenode-filter "/*/*/OperationHeadingLevelTests/*"

Renaming the property-list class in _PropertyList.cshtml fails all three new tests.

🤖 Generated with Claude Code

`OperationHeadingLevelTests` compared the whole 896-line operation page. It now keeps the heading outline check and snapshots the path parameters, query parameters and request body sections separately (416 lines in total), so an unrelated change to the page no longer breaks it. `AGENTS.md` now describes how to write and accept HTML snapshots.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@akira28
akira28 requested a review from a team as a code owner November 4, 2026 16:31
@akira28 akira28 added the chore label Nov 4, 2026
@akira28
akira28 requested a review from Mpdreamz November 4, 2026 16:31
@akira28
akira28 enabled auto-merge (squash) November 4, 2026 16:32
@akira28
akira28 disabled auto-merge November 4, 2026 16:35
The request body section holds an applicability popover whose data payload changes with shared product text, so the snapshot ignores it as the whole-page one did.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@akira28
akira28 enabled auto-merge (squash) November 4, 2026 16:37
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Docs preview (local build)

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

Sample changed pages:

@akira28
akira28 disabled auto-merge November 4, 2026 16:52
@akira28
akira28 merged commit c64b43f into main Nov 4, 2026
36 checks passed
@akira28
akira28 deleted the test/operation-partial-snapshots branch November 4, 2026 16:53
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