This repository was archived by the owner on Feb 28, 2026. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed
packages/player/src/views/Playlists Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ import { usePlaylistStore } from '../../stores/playlistStore' ;
2+ import { resetInMemoryTauriStore } from '../../test/utils/inMemoryTauriStore' ;
3+
4+ const toastError = vi . fn ( ) ;
5+ const toastSuccess = vi . fn ( ) ;
6+ vi . mock ( 'sonner' , ( ) => ( {
7+ toast : {
8+ error : ( ...args : unknown [ ] ) => toastError ( ...args ) ,
9+ success : ( ...args : unknown [ ] ) => toastSuccess ( ...args ) ,
10+ } ,
11+ } ) ) ;
12+
13+ vi . mock ( '@tauri-apps/plugin-fs' , async ( ) => ( {
14+ readTextFile : vi . fn ( ) ,
15+ writeTextFile : vi . fn ( ) ,
16+ } ) ) ;
17+
18+ describe ( 'import from URL' , ( ) => {
19+ beforeEach ( ( ) => {
20+ resetInMemoryTauriStore ( ) ;
21+ usePlaylistStore . setState ( {
22+ index : [ ] ,
23+ playlists : new Map ( ) ,
24+ loaded : true ,
25+ } ) ;
26+ } ) ;
27+
28+ it . todo ( 'opens the URL import dialog' ) ;
29+
30+ it . todo ( 'disables the import button when the URL input is empty' ) ;
31+
32+ it . todo ( 'imports a playlist from a URL and shows it in the list' ) ;
33+
34+ it . todo ( 'marks the imported playlist as read-only with provider origin' ) ;
35+
36+ it . todo ( 'closes the dialog after a successful import' ) ;
37+
38+ it . todo ( 'shows an error when no providers are registered' ) ;
39+
40+ it . todo ( 'shows an error when no provider matches the URL' ) ;
41+
42+ it . todo ( 'shows an error when the provider fails to fetch' ) ;
43+
44+ it . todo ( 'shows an error when the provider returns invalid data' ) ;
45+ } ) ;
You can’t perform that action at this time.
0 commit comments