@@ -11,7 +11,7 @@ import {
1111 stopAdvancedThemeWatcher ,
1212} from '../../services/advancedThemeDirService' ;
1313import { useSettingsStore } from '../../stores/settingsStore' ;
14- import { PluginFsMock , watchCb } from '../../test/mocks/plugin-fs' ;
14+ import { PluginFsMock , watchImmediateCb } from '../../test/mocks/plugin-fs' ;
1515import { ThemesWrapper } from './Themes.test-wrapper' ;
1616
1717vi . mock ( '@tauri-apps/plugin-store' , async ( ) => {
@@ -160,7 +160,7 @@ describe('Themes view', async () => {
160160 await ThemesWrapper . selectAdvancedTheme ( 'My Theme' ) ;
161161 expect ( themes . applyAdvancedTheme ) . toHaveBeenCalledTimes ( 1 ) ;
162162
163- watchCb ?.( { paths : [ 'themes/my.json' ] } ) ;
163+ watchImmediateCb ?.( { paths : [ 'themes/my.json' ] , type : 'any' , attrs : { } } ) ;
164164
165165 await waitFor ( ( ) =>
166166 expect ( themes . applyAdvancedTheme ) . toHaveBeenCalledTimes ( 2 ) ,
@@ -196,15 +196,15 @@ describe('Themes view', async () => {
196196 expect ( themes . applyAdvancedTheme ) . toHaveBeenCalledTimes ( 1 ) ;
197197
198198 // Change unrelated file -> no reload
199- watchCb ?.( { paths : [ '/appdata/themes/other.json' ] } ) ;
199+ watchImmediateCb ?.( { paths : [ '/appdata/themes/other.json' ] } ) ;
200200 await new Promise ( ( r ) => setTimeout ( r , 0 ) ) ;
201201 expect ( themes . applyAdvancedTheme ) . toHaveBeenCalledTimes ( 1 ) ;
202202
203203 // Switch back to Default (basic mode)
204204 await ThemesWrapper . selectDefaultTheme ( ) ;
205205
206206 // Now even if the same file changes, no reload should occur
207- watchCb ?.( { paths : [ '/appdata/themes/my.json' ] } ) ;
207+ watchImmediateCb ?.( { paths : [ '/appdata/themes/my.json' ] } ) ;
208208 expect ( themes . applyAdvancedTheme ) . toHaveBeenCalledTimes ( 1 ) ;
209209 } ) ;
210210
0 commit comments