Skip to content

Commit

Permalink
chore : test video attributes - align, anchor, muted, caption, classn…
Browse files Browse the repository at this point in the history
…ame, style, lock
  • Loading branch information
Ta5r committed Sep 25, 2024
1 parent 7990b99 commit 39aa666
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions tests/unit/CoreVideoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ public function setUp(): void {
' ',
trim(
'
<!-- wp:video {"id":1636} -->
<figure class="wp-block-video"><video autoplay loop 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></figure>
<!-- wp:video {"id":1636,"align":"wide","lock":{"move":true,"remove":true},"className":"test-css-class"} -->
<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 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>
<!-- /wp:video -->
'
)
Expand Down Expand Up @@ -48,11 +50,14 @@ public function test_retrieve_core_video_attributes() {
align
anchor
autoplay
className
lock
tracks
muted
caption
preload
src
style
playsInline
controls
loop
Expand Down Expand Up @@ -84,17 +89,20 @@ public function test_retrieve_core_video_attributes() {

$this->assertEquals(
[
'align' => null,
'anchor' => null,
'align' => 'wide',
'anchor' => 'test-anchor',
'autoplay' => null, // @todo : 'autoplay' should be true.
'tracks' => [],
'muted' => null,
'caption' => null,
'muted' => null, // @todo : 'muted' should be 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.
'controls' => true,
'loop' => null, // @todo : 'loop' should be true.
'lock' => wp_json_encode( [ 'move' => true, 'remove' => true ] ),
'poster' => 'http://mysite.local/wp-content/uploads/2023/05/pexels-egor-komarov-14420089-scaled.jpg',
'id' => 1636.0,
],
Expand Down

0 comments on commit 39aa666

Please sign in to comment.