There currently is no test for the "Add current breadcrumb as structured data" (ADD_STRUCTURED_DATA_JSON_LD) config.
Issue fork easy_breadcrumb-3615292
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
loopduplicate commentedComment #4
csakiistvanComment #5
csakiistvanEnvironment
Prerequisites
2.xbranch inside a Drupal 11.4.4 site.grep -rn ADD_STRUCTURED_DATA_JSON_LD web/modules/contrib/easy_breadcrumb/tests/returns no matches.Steps
tests/src/Functional/EasyBreadcrumbAddJsonLdTest.php, a functional test that asserts noapplication/ld+jsonelement is present in the head with Add current breadcrumb as structured data disabled, and that aBreadcrumbListelement appears once the setting is enabled.ddev drush crsrc/EasyBreadcrumbStructuredDataJsonLd.php(around line 85) so the markup is never built, and run the test again.EasyBreadcrumbStructuredDataJsonLd.phpand run the test a final time.Expected results
2.x.Actual results
Before the fix no test referenced
ADD_STRUCTURED_DATA_JSON_LD, so the "Add current breadcrumb as structured data" setting was completely uncovered. After applying MR !205 the new test ran green (1 test, 5 assertions; only pre-existing unrelated deprecation notices). Disabling the JSON-LD branch made it fail withBehat\Mink\Exception\ElementNotFoundException: Element matching css "head script[type="application/ld+json"]" not found., confirming the assertions are meaningful. Reverting the service restored a green run.Testing produced with the assistance of an LLM.
Comment #6
csakiistvanComment #8
loopduplicate commentedThanks @csakiistvan :3