Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabled custom thumbnail UI for looped videos #1457

Merged
merged 2 commits into from
Mar 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 17 additions & 19 deletions packages/koenig-lexical/src/components/ui/cards/VideoCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,25 +94,23 @@ function PopulatedVideoCard({
label='Loop'
onChange={onLoopChange}
/>
{!isLoopChecked && (
<MediaUploadSetting
alt='Custom thumbnail'
borderStyle={'rounded'}
dataTestId="custom-thumbnail-replace"
errors={customThumbnailUploader.errors}
icon='file'
isDraggedOver={thumbnailDragHandler.isDraggedOver}
isLoading={customThumbnailUploader.isLoading}
label='Custom thumbnail'
mimeTypes={thumbnailMimeTypes}
placeholderRef={thumbnailDragHandler.setRef}
progress={customThumbnailUploader.progress}
size='xsmall'
src={customThumbnail}
onFileChange={onCustomThumbnailChange}
onRemoveMedia={onRemoveCustomThumbnail}
/>
)}
<MediaUploadSetting
alt='Custom thumbnail'
borderStyle={'rounded'}
dataTestId="custom-thumbnail-replace"
errors={customThumbnailUploader.errors}
icon='file'
isDraggedOver={thumbnailDragHandler.isDraggedOver}
isLoading={customThumbnailUploader.isLoading}
label='Custom thumbnail'
mimeTypes={thumbnailMimeTypes}
placeholderRef={thumbnailDragHandler.setRef}
progress={customThumbnailUploader.progress}
size='xsmall'
src={customThumbnail}
onFileChange={onCustomThumbnailChange}
onRemoveMedia={onRemoveCustomThumbnail}
/>
</SettingsPanel>
)
}
Expand Down
18 changes: 0 additions & 18 deletions packages/koenig-lexical/test/e2e/cards/video-card.firefox.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,24 +212,6 @@ test.describe('Video card', async () => {
await expect(await page.getByTestId('media-upload-errors')).toBeVisible();
});

test('can hide custom thumbnail if loop enabled', async function () {
await focusEditor(page);
await uploadVideo(page);

// Loop toggle should be visible and unchecked
const loopButton = await page.getByTestId('loop-video');
await expect(loopButton).toBeVisible();
await expect(await page.locator('[data-testid="loop-video"] input').isChecked()).toBeFalsy();

// Custom thumbnail should be visible
const emptyThumbnail = await page.getByTestId('media-upload-placeholder');
await expect(emptyThumbnail).toBeVisible();

// Custom thumbnail should be hidden after loop enabled
await loopButton.check();
await expect(page.getByTestId('media-upload-placeholder')).toBeHidden();
});

test('can upload dropped video', async function () {
const filePath = path.relative(process.cwd(), __dirname + '/../fixtures/video.mp4');
const fileChooserPromise = page.waitForEvent('filechooser');
Expand Down
Loading