Skip to content

SITES-42542 - docs and integration test for Structured Data (JSON-LD) Injection in Page#3037

Merged
LSantha merged 3 commits into
mainfrom
SITES-42542-2
May 18, 2026
Merged

SITES-42542 - docs and integration test for Structured Data (JSON-LD) Injection in Page#3037
LSantha merged 3 commits into
mainfrom
SITES-42542-2

Conversation

@LSantha
Copy link
Copy Markdown
Contributor

@LSantha LSantha commented May 15, 2026

Q A
Fixed Issues? Follow-up to #3029 / SITES-42542
Patch: Bug Fix? No
Minor: New Feature? No (docs + test only)
Major: Breaking Change? No
Tests Added + Pass? Yes (1 IT case, toggle-gated)
Documentation Provided Yes (Page v1/v2/v3 README)
Any Dependency Changes? No
License Apache License, Version 2.0

Follow-up to #3029, which wired <sly data-sly-include="structureddata.html"></sly> into the Page v1/v2/v3 head.html but did not update docs or add a smoke test on this side.

What this PR adds

Docs — Page v1/v2/v3 README.md:

  • Adds a Features bullet: Structured Data (JSON-LD) injection in the page head.
  • Page v3 only: lists the inherited ./cq:structuredData property in the Edit Dialog Properties section.

Integration testtesting/it/http (Page v3 PageIT):

  • One test method testStructuredData that GETs simple-page-v3.html and asserts a <script type="application/ld+json">…</script> tag with the seeded JSON-LD block is present in the rendered output.
  • Gated with @RunIfToggleEnabled("FT_SITES-42542") so it is skipped when the foundation feature toggle is off (same pattern as ImageIT#testNgdmImage).
  • Seeds cq:structuredData on the existing simple-page-v3 test page (no new content node).

Why minimal

Model-level behaviour (JSON compaction, </ escaping, toggle-off → empty list, multi-block ordering, etc.) is already covered by StructuredDataImplTest in the foundation bundle. This PR intentionally only smoke-tests the HTL wiring — one assertion that the script tag lands in <head> — to avoid duplicating that coverage. The wiring is identical across Page v1/v2/v3, so a single v3 case is sufficient.

Verification

  • mvn test-compile on testing/it/http — passes.
  • mvn package on testing/it/it.ui.content — passes.
  • The IT itself needs an AEM instance with the foundation SITES-42542 work deployed and FT_SITES-42542 enabled; otherwise it is skipped.

Pull Request opened by Augment Code with guidance from the PR author

LSantha added 2 commits May 15, 2026 17:34
…njection

 * document Structured Data (JSON-LD) injection feature in Page v1, v2, v3 README

 * list the inherited cq:structuredData edit dialog property in Page v3 README
…njection

 * add minimal integration test verifying JSON-LD script tag is emitted in Page v3 head

 * gate test with @RunIfToggleEnabled("FT_SITES-42542") so it is skipped when the feature toggle is off

 * seed cq:structuredData on the existing simple-page-v3 test content
@LSantha LSantha marked this pull request as ready for review May 15, 2026 14:52
@codecov
Copy link
Copy Markdown

codecov Bot commented May 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

…njection

 * list cq:structuredData edit dialog property in Page v1 and v2 README
@sonarqubecloud
Copy link
Copy Markdown

@YahorC YahorC added this to the 2.31.0 milestone May 18, 2026
@LSantha LSantha merged commit 32c2a3d into main May 18, 2026
13 checks passed
@LSantha LSantha deleted the SITES-42542-2 branch May 18, 2026 08:49
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.

2 participants