From 74f3704a4de8399eb5e6dad76f61bff7393e7b31 Mon Sep 17 00:00:00 2001
From: Alex Cicovic <23142906+acicovic@users.noreply.github.com>
Date: Tue, 10 Dec 2024 13:53:49 +0200
Subject: [PATCH] Add identifier to JSON-LD metadata
---
src/Metadata/class-metadata-renderer.php | 2 +-
tests/Integration/Endpoints/RestMetadataTest.php | 2 +-
tests/Integration/UI/MetadataRendererTest.php | 2 +-
tests/e2e/specs/front-end-metadata.spec.ts | 12 ++++++------
4 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/Metadata/class-metadata-renderer.php b/src/Metadata/class-metadata-renderer.php
index 222a55620..d6d9a2c42 100644
--- a/src/Metadata/class-metadata-renderer.php
+++ b/src/Metadata/class-metadata-renderer.php
@@ -109,7 +109,7 @@ public function render_metadata( string $meta_type ): void {
// Insert JSON-LD or repeated metas.
if ( 'json_ld' === $meta_type ) {
- echo '';
+ echo '';
} else {
// Assume `meta_type` is `repeated_metas`.
$parsely_post_type = $this->parsely->convert_jsonld_to_parsely_type( $metadata['@type'] ?? '' );
diff --git a/tests/Integration/Endpoints/RestMetadataTest.php b/tests/Integration/Endpoints/RestMetadataTest.php
index 23854b34c..e369adbbf 100644
--- a/tests/Integration/Endpoints/RestMetadataTest.php
+++ b/tests/Integration/Endpoints/RestMetadataTest.php
@@ -403,7 +403,7 @@ public function test_get_rendered_meta_json_ld(): void {
$this->go_to( (string) $this->get_permalink( $post_id ) );
$meta_string = self::$rest->get_rendered_meta( 'json_ld' );
- $expected = '';
+ $expected = '';
self::assertSame( $expected, $meta_string );
}
diff --git a/tests/Integration/UI/MetadataRendererTest.php b/tests/Integration/UI/MetadataRendererTest.php
index 9d9624c21..7ae4f48f0 100644
--- a/tests/Integration/UI/MetadataRendererTest.php
+++ b/tests/Integration/UI/MetadataRendererTest.php
@@ -123,7 +123,7 @@ public function test_render_metadata_json_ld(): void {
*/
$out = ob_get_clean();
- self::assertStringContainsString( '', $out );
}
diff --git a/tests/e2e/specs/front-end-metadata.spec.ts b/tests/e2e/specs/front-end-metadata.spec.ts
index 3ed7ba014..42fd5feaf 100644
--- a/tests/e2e/specs/front-end-metadata.spec.ts
+++ b/tests/e2e/specs/front-end-metadata.spec.ts
@@ -53,7 +53,7 @@ test.describe( 'Front end metadata insertion', () => {
const content = await page.content();
- expect( content ).toContain( '' );
+ expect( content ).toContain( '' );
expect( content ).not.toContain( ' {
const content = await page.content();
- expect( content ).toContain( '