mirror of
https://github.com/koel/koel
synced 2024-12-24 11:33:05 +00:00
20 lines
630 B
TypeScript
20 lines
630 B
TypeScript
|
import { expect, it } from 'vitest'
|
||
|
import UnitTestCase from '@/__tests__/UnitTestCase'
|
||
|
import { settingStore } from '@/stores/settingStore'
|
||
|
import { httpService } from '@/services'
|
||
|
|
||
|
new class extends UnitTestCase {
|
||
|
protected test () {
|
||
|
it('initializes the store', () => {
|
||
|
settingStore.init({ media_path: '/media/path' })
|
||
|
expect(settingStore.state.media_path).toEqual('/media/path')
|
||
|
})
|
||
|
|
||
|
it('updates the media path', async () => {
|
||
|
this.mock(httpService, 'put')
|
||
|
await settingStore.update({ media_path: '/dev/null' })
|
||
|
expect(settingStore.state.media_path).toEqual('/dev/null')
|
||
|
})
|
||
|
}
|
||
|
}
|