mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-08 09:16:58 +08:00
fix(discover): default music chart to albums
This commit is contained in:
@@ -7,8 +7,8 @@ const { t } = useI18n()
|
|||||||
// 探索模式:对齐 ListenBrainz 官方的热门统计与新发行两个入口
|
// 探索模式:对齐 ListenBrainz 官方的热门统计与新发行两个入口
|
||||||
const mode = ref<'chart' | 'fresh'>('chart')
|
const mode = ref<'chart' | 'fresh'>('chart')
|
||||||
|
|
||||||
// 热门榜单实体:官方统计页面的热门单曲与热门专辑
|
// 专辑榜更适合作为探索首屏,避免同一热门专辑的单曲重复占据多个卡片
|
||||||
const entity = ref('recording')
|
const entity = ref('album')
|
||||||
|
|
||||||
// 热门榜单周期,取值与官方统计页面一致
|
// 热门榜单周期,取值与官方统计页面一致
|
||||||
const rangeName = ref('this_month')
|
const rangeName = ref('this_month')
|
||||||
|
|||||||
@@ -18,14 +18,14 @@ function renderMusicView() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
describe('MusicView', () => {
|
describe('MusicView', () => {
|
||||||
it('defaults to the sitewide top tracks chart of the current month', async () => {
|
it('defaults to the sitewide top albums chart of the current month', async () => {
|
||||||
await renderMusicView()
|
await renderMusicView()
|
||||||
|
|
||||||
const params = screen.getByTestId('music-params')
|
const params = screen.getByTestId('music-params')
|
||||||
expect(params).toHaveTextContent('"media_source":"musicbrainz"')
|
expect(params).toHaveTextContent('"media_source":"musicbrainz"')
|
||||||
expect(params).not.toHaveTextContent('"source"')
|
expect(params).not.toHaveTextContent('"source"')
|
||||||
expect(params).toHaveTextContent('"mode":"chart"')
|
expect(params).toHaveTextContent('"mode":"chart"')
|
||||||
expect(params).toHaveTextContent('"entity":"recording"')
|
expect(params).toHaveTextContent('"entity":"album"')
|
||||||
expect(params).toHaveTextContent('"range_name":"this_month"')
|
expect(params).toHaveTextContent('"range_name":"this_month"')
|
||||||
expect(params).toHaveTextContent('"sort_by":"listen_count.desc"')
|
expect(params).toHaveTextContent('"sort_by":"listen_count.desc"')
|
||||||
})
|
})
|
||||||
@@ -34,13 +34,13 @@ describe('MusicView', () => {
|
|||||||
const user = userEvent.setup()
|
const user = userEvent.setup()
|
||||||
await renderMusicView()
|
await renderMusicView()
|
||||||
|
|
||||||
await user.click(screen.getByText('热门专辑'))
|
await user.click(screen.getByText('热门单曲'))
|
||||||
await user.click(screen.getByText('过去一季'))
|
await user.click(screen.getByText('过去一季'))
|
||||||
await user.click(screen.getByText('收听最少'))
|
await user.click(screen.getByText('收听最少'))
|
||||||
await user.click(screen.getByText('仅有封面'))
|
await user.click(screen.getByText('仅有封面'))
|
||||||
|
|
||||||
const params = screen.getByTestId('music-params')
|
const params = screen.getByTestId('music-params')
|
||||||
expect(params).toHaveTextContent('"entity":"album"')
|
expect(params).toHaveTextContent('"entity":"recording"')
|
||||||
expect(params).toHaveTextContent('"range_name":"quarter"')
|
expect(params).toHaveTextContent('"range_name":"quarter"')
|
||||||
expect(params).toHaveTextContent('"sort_by":"listen_count.asc"')
|
expect(params).toHaveTextContent('"sort_by":"listen_count.asc"')
|
||||||
expect(params).toHaveTextContent('"with_cover":true')
|
expect(params).toHaveTextContent('"with_cover":true')
|
||||||
|
|||||||
Reference in New Issue
Block a user