mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-04 23:24:21 +00:00
feat(transcode): add multi-resolution strategy with configurable ladders and fallback (#438)
* feat(transcode): add multi-resolution strategy with configurable ladders and fallback * feat(settings): show toast on settings update and add manual verification plan to PR template * fix(webui): preserve video resolution and fix 480p label in download dropdowns * fix(webui): display standard short-side resolution for vertical videos in seekbar * fix(webui): fix portrait transcode resolution labeling and serialize settings toggles
This commit is contained in:
@@ -119,4 +119,69 @@ describe('MobileFileHeader', () => {
|
||||
expect(menuBtn).toBeDefined()
|
||||
fireEvent.click(menuBtn)
|
||||
})
|
||||
|
||||
it('displays 480p instead of 360p for 480p video transcode in download menu', () => {
|
||||
render(
|
||||
<MobileFileHeader
|
||||
fileName="scene1.mp4"
|
||||
activeFileId="file-1"
|
||||
allowDownload={true}
|
||||
onBack={vi.fn()}
|
||||
downloadInfo={{
|
||||
originalKey: 'raw.mov',
|
||||
videoTranscodes: [
|
||||
{
|
||||
key: 'scene1-480p.mp4',
|
||||
width: 854,
|
||||
height: 480,
|
||||
resolution: '480p',
|
||||
hdr: false,
|
||||
},
|
||||
],
|
||||
}}
|
||||
/>,
|
||||
)
|
||||
|
||||
const menuBtn = screen.getByLabelText(/More options/i)
|
||||
fireEvent.pointerDown(menuBtn, { button: 0, ctrlKey: false })
|
||||
|
||||
const downloadSubTrigger = screen.getByText('Download')
|
||||
fireEvent.click(downloadSubTrigger)
|
||||
|
||||
const items = screen.getAllByRole('menuitem')
|
||||
expect(items.some((i) => i.textContent?.includes('480p'))).toBe(true)
|
||||
expect(items.some((i) => i.textContent?.includes('360p'))).toBe(false)
|
||||
})
|
||||
|
||||
it('correctly labels legacy portrait video transcode in download menu using long side fallback', () => {
|
||||
render(
|
||||
<MobileFileHeader
|
||||
fileName="portrait.mp4"
|
||||
activeFileId="file-portrait"
|
||||
allowDownload={true}
|
||||
onBack={vi.fn()}
|
||||
downloadInfo={{
|
||||
originalKey: 'raw.mp4',
|
||||
videoTranscodes: [
|
||||
{
|
||||
key: 'portrait-legacy.mp4',
|
||||
width: 1080,
|
||||
height: 1920,
|
||||
hdr: false,
|
||||
},
|
||||
],
|
||||
}}
|
||||
/>,
|
||||
)
|
||||
|
||||
const menuBtn = screen.getByLabelText(/More options/i)
|
||||
fireEvent.pointerDown(menuBtn, { button: 0, ctrlKey: false })
|
||||
|
||||
const downloadSubTrigger = screen.getByText('Download')
|
||||
fireEvent.click(downloadSubTrigger)
|
||||
|
||||
const items = screen.getAllByRole('menuitem')
|
||||
expect(items.some((i) => i.textContent?.includes('1080p'))).toBe(true)
|
||||
expect(items.some((i) => i.textContent?.includes('1920p'))).toBe(false)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user