mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-09 01:36:45 +08:00
fix tests
This commit is contained in:
@@ -1181,6 +1181,12 @@ export interface MetaInfo {
|
|||||||
video_encode?: string
|
video_encode?: string
|
||||||
// 音频编码
|
// 音频编码
|
||||||
audio_encode?: string
|
audio_encode?: string
|
||||||
|
// 音频格式
|
||||||
|
audio_format?: string
|
||||||
|
// 音频位深
|
||||||
|
bit_depth?: number
|
||||||
|
// 音频采样率
|
||||||
|
sample_rate?: number
|
||||||
// 名称(自动中英文)
|
// 名称(自动中英文)
|
||||||
name: string
|
name: string
|
||||||
// SXX-SXX
|
// SXX-SXX
|
||||||
|
|||||||
@@ -10,6 +10,9 @@ describe('MediaInfoCard', () => {
|
|||||||
context: {
|
context: {
|
||||||
meta_info: {
|
meta_info: {
|
||||||
artists: ['周杰伦'],
|
artists: ['周杰伦'],
|
||||||
|
audio_format: 'FLAC',
|
||||||
|
bit_depth: 24,
|
||||||
|
sample_rate: 48000,
|
||||||
title: '晴天',
|
title: '晴天',
|
||||||
type: '音乐',
|
type: '音乐',
|
||||||
},
|
},
|
||||||
@@ -23,6 +26,8 @@ describe('MediaInfoCard', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
expect(screen.getByText('晴天')).toBeInTheDocument()
|
expect(screen.getByText('晴天')).toBeInTheDocument()
|
||||||
|
expect(screen.getByText('FLAC')).toBeInTheDocument()
|
||||||
|
expect(screen.getByText('24 kHz 48000')).toBeInTheDocument()
|
||||||
expect(screen.queryByText('识别失败,无法识别到有效信息!')).not.toBeInTheDocument()
|
expect(screen.queryByText('识别失败,无法识别到有效信息!')).not.toBeInTheDocument()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -319,7 +319,9 @@ onMounted(() => {
|
|||||||
v-model="mediaId"
|
v-model="mediaId"
|
||||||
:label="mediaIdLabel"
|
:label="mediaIdLabel"
|
||||||
:placeholder="t('dialog.reorganize.mediaIdPlaceholder')"
|
:placeholder="t('dialog.reorganize.mediaIdPlaceholder')"
|
||||||
:rules="[(value: any) => isValidMediaSourceId(value, mediaSource.value) || t('dialog.reorganize.mediaIdInvalid')]"
|
:rules="[
|
||||||
|
(value: any) => isValidMediaSourceId(value, mediaSource) || t('dialog.reorganize.mediaIdInvalid'),
|
||||||
|
]"
|
||||||
append-inner-icon="mdi-magnify"
|
append-inner-icon="mdi-magnify"
|
||||||
:hint="t('dialog.reorganize.mediaIdHint')"
|
:hint="t('dialog.reorganize.mediaIdHint')"
|
||||||
persistent-hint
|
persistent-hint
|
||||||
|
|||||||
@@ -443,7 +443,8 @@ describe('SiteResourceDialog', () => {
|
|||||||
await waitFor(() => expect(screen.queryByLabelText('搜索关键字')).not.toBeInTheDocument())
|
await waitFor(() => expect(screen.queryByLabelText('搜索关键字')).not.toBeInTheDocument())
|
||||||
})
|
})
|
||||||
|
|
||||||
it('emits close and formats the result summary in English', async () => {
|
it('emits close and formats the mobile result summary in English', async () => {
|
||||||
|
setViewport(390)
|
||||||
server.use(
|
server.use(
|
||||||
siteCategoriesHandler(501, []),
|
siteCategoriesHandler(501, []),
|
||||||
siteResourcesHandler(501, [createTorrentInfo({ title: 'Language resource' })]),
|
siteResourcesHandler(501, [createTorrentInfo({ title: 'Language resource' })]),
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ const $toast = useToast()
|
|||||||
const mediaProps = defineProps({
|
const mediaProps = defineProps({
|
||||||
mediaid: String,
|
mediaid: String,
|
||||||
title: String,
|
title: String,
|
||||||
year: String,
|
year: [String, Number],
|
||||||
type: String,
|
type: String,
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -557,7 +557,7 @@ async function handleDoubanClick() {
|
|||||||
mediaDetail.value.douban_id,
|
mediaDetail.value.douban_id,
|
||||||
mediaDetail.value.type,
|
mediaDetail.value.type,
|
||||||
mediaDetail.value.title,
|
mediaDetail.value.title,
|
||||||
mediaDetail.value.year,
|
mediaDetail.value.year?.toString(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -330,7 +330,7 @@ describe('MediaDetailView detail and actions', () => {
|
|||||||
tmdb_id: 8401,
|
tmdb_id: 8401,
|
||||||
tvdb_id: 'tvdb-8401',
|
tvdb_id: 'tvdb-8401',
|
||||||
type: '电影',
|
type: '电影',
|
||||||
year: '2025',
|
year: 2025,
|
||||||
})
|
})
|
||||||
await renderDetail({ media })
|
await renderDetail({ media })
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user