From b4d3c5b40e5a16480156a8106eff682a39648bdf Mon Sep 17 00:00:00 2001 From: Ta5r Date: Wed, 25 Sep 2024 17:36:39 +0530 Subject: [PATCH] fix : fix broken atts - autoplay, muted, playsInline, loop. --- tests/unit/CoreVideoTest.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/unit/CoreVideoTest.php b/tests/unit/CoreVideoTest.php index 553154aa..72365c6f 100644 --- a/tests/unit/CoreVideoTest.php +++ b/tests/unit/CoreVideoTest.php @@ -29,6 +29,7 @@ public function setUp(): void { public function tearDown(): void { // your tear down methods here wp_delete_post( $this->post_id, true ); + parent::tearDown(); \WPGraphQL::clear_schema(); @@ -88,7 +89,7 @@ public function test_retrieve_core_video_attributes(): void { $block_content = '
- +
Sample caption
'; @@ -131,17 +132,17 @@ public function test_retrieve_core_video_attributes(): void { [ 'align' => 'wide', 'anchor' => 'test-anchor', - 'autoplay' => null, // @todo : 'autoplay' should be true. + 'autoplay' => true, 'tracks' => [], - 'muted' => null, // @todo : 'muted' should be true. + 'muted' => true, 'caption' => 'Sample caption', 'className' => 'test-css-class', 'preload' => 'auto', 'src' => 'http://mysite.local/wp-content/uploads/2023/07/pexels_videos_1860684-1440p.mp4', 'style' => null, // @todo : 'style' should be '{\"spacing\":{\"margin\":{\"top\":\"var:preset|spacing|50\",\"bottom\":\"var:preset|spacing|50\",\"left\":\"var:preset|spacing|50\",\"right\":\"var:preset|spacing|50\"}}}'. - 'playsInline' => null, // @todo : 'playsInline' should be true. + 'playsInline' => true, 'controls' => true, - 'loop' => null, // @todo : 'loop' should be true. + 'loop' => true, 'lock' => wp_json_encode( [ 'move' => true, @@ -205,7 +206,7 @@ public function test_retrieve_core_video_tracks_attribute(): void { $this->assertCount( 1, $tracks ); $this->assertEquals( - wp_json_encode( + wp_json_encode( // Previously untested. [ 'src' => 'https://example.com/subtitles.vtt', 'kind' => 'subtitles',