-
Notifications
You must be signed in to change notification settings - Fork 812
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
VideoPress: Fix video overflow area in float containers and flex posi…
…tion in row blocks (#41789) * Fix center-aligned video and remove line-height in the editor * Fix flex position for videos inside row blocks * Fix video area overflow for multiple float videos * changelog * Add tests * Add player tests
- Loading branch information
Showing
6 changed files
with
137 additions
and
4 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
projects/packages/videopress/changelog/fix-videopress-block-float-align
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: fixed | ||
|
||
Fix flex position for videos inside row blocks. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
...ges/videopress/src/client/block-editor/blocks/video/components/player/test/index.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/** | ||
* @jest-environment jsdom | ||
*/ | ||
|
||
import { render, screen } from '@testing-library/react'; | ||
import { VideoBlockAttributes } from '../../../types'; | ||
import Player from '../index'; | ||
|
||
const baseAttributes: VideoBlockAttributes = { | ||
videoRatio: 100, | ||
autoplay: true, | ||
align: 'center', | ||
posterData: { | ||
type: 'media-library', | ||
id: 1, | ||
url: 'https://videopress.com/wp-content/uploads/2024/10/placeholder-video-1.mp4', | ||
}, | ||
}; | ||
|
||
const previewMock = { | ||
html: '', | ||
width: 0, | ||
height: 0, | ||
thumbnail_height: 0, | ||
thumbnail_width: 0, | ||
version: '', | ||
title: '', | ||
type: '', | ||
provider_name: '', | ||
provider_url: '', | ||
}; | ||
|
||
describe( 'Player', () => { | ||
it( 'should render', () => { | ||
render( | ||
<Player | ||
showCaption={ true } | ||
isSelected={ false } | ||
attributes={ baseAttributes } | ||
setAttributes={ () => {} } | ||
preview={ previewMock } | ||
isRequestingEmbedPreview={ false } | ||
html="" | ||
/> | ||
); | ||
|
||
expect( screen.getByRole( 'figure' ) ).toBeInTheDocument(); | ||
} ); | ||
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters