Skip to content

Commit

Permalink
fix: update test to check style atts.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ta5r committed Sep 25, 2024
1 parent b4d3c5b commit 16f6776
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions tests/unit/CoreVideoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ className
*/
public function test_retrieve_core_video_attributes(): void {
$block_content = '
<!-- wp:video {"id":1636,"align":"wide","lock":{"move":true,"remove":true},"className":"test-css-class"} -->
<!-- wp:video {"id":1636,"align":"wide","lock":{"move":true,"remove":true},"className":"test-css-class","style":{"spacing":{"margin":{"top":"var:preset|spacing|10","bottom":"var:preset|spacing|10","left":"var:preset|spacing|20","right":"var:preset|spacing|20"}}}} -->
<figure id="test-anchor" class="wp-block-video" style="margin-top:var(--wp--preset--spacing--50);margin-right:var(--wp--preset--spacing--50);margin-bottom:var(--wp--preset--spacing--50);margin-left:var(--wp--preset--spacing--50)">
<video autoplay controls loop muted poster="http://mysite.local/wp-content/uploads/2023/05/pexels-egor-komarov-14420089-scaled.jpg" preload="auto" src="http://mysite.local/wp-content/uploads/2023/07/pexels_videos_1860684-1440p.mp4" playsinline></video>
<figcaption class="wp-element-caption">Sample caption</figcaption></figure>
Expand Down Expand Up @@ -139,7 +139,18 @@ public function test_retrieve_core_video_attributes(): void {
'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\"}}}'.
'style' => wp_json_encode(
[
'spacing' => [
'margin' => [
'top' => 'var:preset|spacing|10',
'bottom' => 'var:preset|spacing|10',
'left' => 'var:preset|spacing|20',
'right' => 'var:preset|spacing|20',
],
],
]
),
'playsInline' => true,
'controls' => true,
'loop' => true,
Expand Down

0 comments on commit 16f6776

Please sign in to comment.