@@ -97,3 +97,31 @@ test("app.js: registriert Service Worker", () => {
9797 const src = fs . readFileSync ( appJsPath , "utf8" ) ;
9898 assert . match ( src , / s e r v i c e W o r k e r \. r e g i s t e r / ) ;
9999} ) ;
100+
101+ // --- Bug-Fix-Assertions ---
102+
103+ test ( "sw.js: caches.match setzt ignoreSearch:true (Offline-Fallback bei ?-Params)" , ( ) => {
104+ const src = fs . readFileSync ( swPath , "utf8" ) ;
105+ assert . match ( src , / i g n o r e S e a r c h : \s * t r u e / , "caches.match muss ignoreSearch:true setzen – offline schlägt bei ?demo=1 fehl" ) ;
106+ } ) ;
107+
108+ test ( "index.html: apple-touch-icon vorhanden (iOS Homescreen-Icon)" , ( ) => {
109+ const html = fs . readFileSync ( indexPath , "utf8" ) ;
110+ assert . match ( html , / r e l = " a p p l e - t o u c h - i c o n " / , "apple-touch-icon fehlt – iOS zeigt generischen Screenshot" ) ;
111+ } ) ;
112+
113+ test ( "manifest: lang-Feld vorhanden" , ( ) => {
114+ const m = JSON . parse ( fs . readFileSync ( manifestPath , "utf8" ) ) ;
115+ assert . ok ( m . lang , "lang fehlt im Manifest" ) ;
116+ } ) ;
117+
118+ test ( "app.js: fileInput-Handler fängt file.text()-Fehler ab" , ( ) => {
119+ const src = fs . readFileSync ( appJsPath , "utf8" ) ;
120+ assert . match ( src , / f i l e \. t e x t \( \) / , "file.text() muss vorhanden sein" ) ;
121+ assert . match ( src , / D a t e i k o n n t e n i c h t g e l e s e n w e r d e n / , "Fehlerfall für file.text() fehlt" ) ;
122+ } ) ;
123+
124+ test ( "app.js: deferredInstallPrompt wird vor prompt() genullt" , ( ) => {
125+ const src = fs . readFileSync ( appJsPath , "utf8" ) ;
126+ assert . match ( src , / d e f e r r e d I n s t a l l P r o m p t \s * = \s * n u l l / , "deferredInstallPrompt muss nach prompt() genullt werden" ) ;
127+ } ) ;
0 commit comments