@@ -905,7 +905,6 @@ console.log("ok");`
905905 "push-uuid.user.js" : "etag-user-js" ,
906906 } ) ;
907907 } ) ;
908-
909908 it ( "skips status and digest update when a push hits remote conflict" , async ( ) => {
910909 const conflict = new FileSystemError ( {
911910 provider : "webdav" ,
@@ -941,20 +940,16 @@ console.log("ok");`
941940 ] ) ,
942941 } as any
943942 ) ;
943+
944944 vi . spyOn ( service , "pushScript" ) . mockRejectedValue ( conflict ) ;
945945 const updateDigestSpy = vi . spyOn ( service , "updateFileDigest" ) ;
946- const notificationSpy = vi . spyOn ( chrome . notifications , "create " ) . mockReturnValue ( "notification-id" as any ) ;
946+ const notifySpy = vi . spyOn ( service , "notifySyncFailed " ) . mockImplementation ( ( ) => { } ) ;
947947
948948 await service . syncOnce ( syncConfig , fs ) ;
949949
950950 expect ( updateDigestSpy ) . not . toHaveBeenCalled ( ) ;
951951 expect ( fs . create ) . not . toHaveBeenCalledWith ( "scriptcat-sync.json" , expect . anything ( ) ) ;
952- expect ( notificationSpy ) . toHaveBeenCalledWith (
953- expect . objectContaining ( {
954- title : "Script Sync Failed" ,
955- message : expect . stringContaining ( "remote conflict" ) ,
956- } )
957- ) ;
952+ expect ( notifySpy ) . toHaveBeenCalledWith ( true , 1 ) ;
958953 } ) ;
959954
960955 it ( "skips status and digest update when any push task fails" , async ( ) => {
@@ -987,20 +982,16 @@ console.log("ok");`
987982 ] ) ,
988983 } as any
989984 ) ;
985+
990986 vi . spyOn ( service , "pushScript" ) . mockRejectedValue ( error ) ;
991987 const updateDigestSpy = vi . spyOn ( service , "updateFileDigest" ) ;
992- const notificationSpy = vi . spyOn ( chrome . notifications , "create " ) . mockReturnValue ( "notification-id" as any ) ;
988+ const notifySpy = vi . spyOn ( service , "notifySyncFailed " ) . mockImplementation ( ( ) => { } ) ;
993989
994990 await service . syncOnce ( syncConfig , fs ) ;
995991
996992 expect ( updateDigestSpy ) . not . toHaveBeenCalled ( ) ;
997993 expect ( fs . create ) . not . toHaveBeenCalledWith ( "scriptcat-sync.json" , expect . anything ( ) ) ;
998- expect ( notificationSpy ) . toHaveBeenCalledWith (
999- expect . objectContaining ( {
1000- title : "Script Sync Failed" ,
1001- message : expect . stringContaining ( "cloud sync changes failed" ) ,
1002- } )
1003- ) ;
994+ expect ( notifySpy ) . toHaveBeenCalledWith ( false , 1 ) ;
1004995 } ) ;
1005996
1006997 it ( "scriptInstall enters cloud_sync queue and updates digest after push" , async ( ) => {
0 commit comments