File tree Expand file tree Collapse file tree
src/app/service/service_worker Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ describe("startDownload", () => {
9595 expect ( callback ) . toHaveBeenCalledTimes ( 1 ) ;
9696 expect ( callback ) . toHaveBeenCalledWith (
9797 expect . objectContaining ( {
98- donwloadId : id ,
98+ downloadId : id ,
9999 state : "complete" ,
100100 } )
101101 ) ;
@@ -150,7 +150,7 @@ describe("startDownload", () => {
150150
151151 expect ( callback ) . toHaveBeenCalledWith (
152152 expect . objectContaining ( {
153- donwloadId : id ,
153+ downloadId : id ,
154154 state : expect . stringMatching ( / i n t e r r u p t e d | s a v e _ c a n c e l l e d / ) , // 仅模拟错误
155155 } )
156156 ) ;
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ const STATE = {
8787type STATE = ValueOf < typeof STATE > ;
8888
8989export type DownloadCallback = {
90- donwloadId : number ;
90+ downloadId : number ;
9191 state : STATE | "save_cancelled" ;
9292 loaded ?: number ;
9393 total ?: number ;
@@ -137,7 +137,7 @@ const onChangedListener = (downloadDelta: chrome.downloads.DownloadDelta) => {
137137 const downloadItem = responseMap . get ( id ) ;
138138
139139 await notifyDownloadCallback ( entry . callback , {
140- donwloadId : id ,
140+ downloadId : id ,
141141 state : state === "interrupted" && filenameConfirmed ? "save_cancelled" : state ,
142142 loaded : downloadItem ?. downloadItem ?. totalBytes , // 兼容 TM,总是传回 totalBytes (与实际有否储存无关)
143143 total : downloadItem ?. downloadItem ?. totalBytes ,
You can’t perform that action at this time.
0 commit comments