mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-17 13:48:02 +00:00
feat: updates
This commit is contained in:
parent
7ce516877e
commit
ccebe0a67a
74 changed files with 56065 additions and 2810 deletions
|
|
@ -9,7 +9,7 @@ import {
|
|||
storage,
|
||||
} from '@/web/utils/common'
|
||||
import { IpcChannels } from '@/shared/IpcChannels'
|
||||
import { APIs } from '@/shared/CacheAPIs'
|
||||
import { CacheAPIs } from '@/shared/CacheAPIs'
|
||||
|
||||
test('resizeImage', () => {
|
||||
expect(resizeImage('https://test.com/test.jpg', 'xs')).toBe(
|
||||
|
|
@ -50,12 +50,8 @@ test('formatDuration', () => {
|
|||
expect(formatDuration(3600000, 'zh-CN', 'hh[hr] mm[min]')).toBe('1 小时')
|
||||
expect(formatDuration(3600000, 'zh-TW', 'hh[hr] mm[min]')).toBe('1 小時')
|
||||
expect(formatDuration(3700000, 'en', 'hh[hr] mm[min]')).toBe('1 hr 1 min')
|
||||
expect(formatDuration(3700000, 'zh-CN', 'hh[hr] mm[min]')).toBe(
|
||||
'1 小时 1 分钟'
|
||||
)
|
||||
expect(formatDuration(3700000, 'zh-TW', 'hh[hr] mm[min]')).toBe(
|
||||
'1 小時 1 分鐘'
|
||||
)
|
||||
expect(formatDuration(3700000, 'zh-CN', 'hh[hr] mm[min]')).toBe('1 小时 1 分钟')
|
||||
expect(formatDuration(3700000, 'zh-TW', 'hh[hr] mm[min]')).toBe('1 小時 1 分鐘')
|
||||
|
||||
expect(formatDuration(0)).toBe('0:00')
|
||||
expect(formatDuration(0, 'en', 'hh[hr] mm[min]')).toBe('0 min')
|
||||
|
|
@ -67,7 +63,7 @@ describe('cacheCoverColor', () => {
|
|||
vi.stubGlobal('ipcRenderer', {
|
||||
send: (channel: IpcChannels, ...args: any[]) => {
|
||||
expect(channel).toBe(IpcChannels.CacheCoverColor)
|
||||
expect(args[0].api).toBe(APIs.CoverColor)
|
||||
expect(args[0].api).toBe(CacheAPIs.CoverColor)
|
||||
expect(args[0].query).toEqual({
|
||||
id: '109951165911363',
|
||||
color: '#fff',
|
||||
|
|
@ -169,7 +165,7 @@ describe('getCoverColor', () => {
|
|||
vi.stubGlobal('ipcRenderer', {
|
||||
sendSync: (channel: IpcChannels, ...args: any[]) => {
|
||||
expect(channel).toBe(IpcChannels.GetApiCache)
|
||||
expect(args[0].api).toBe(APIs.CoverColor)
|
||||
expect(args[0].api).toBe(CacheAPIs.CoverColor)
|
||||
expect(args[0].query).toEqual({
|
||||
id: '109951165911363',
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue