@@ -143,6 +143,26 @@ func TestParseGeminiAppsBrStaysInsidePromptBlock(t *testing.T) {
143143 assert .Equal (t , "answer" , results [0 ].Messages [1 ].Content )
144144}
145145
146+ func TestParseGeminiAppsEmptyFirstContentBlockIsError (t * testing.T ) {
147+ fixture := `<!doctype html><html><head><title>My Activity History</title></head><body>
148+ <div class="outer-cell"><div class="header-cell"><h3>Gemini Apps</h3><p>Prompted</p><p>Jan 2, 2025, 3:04:05 PM EDT</p></div><div class="content-cell"><p></p><p>answer</p></div></div>
149+ </body></html>`
150+ path := filepath .Join (t .TempDir (), "empty-first-block.html" )
151+ require .NoError (t , os .WriteFile (path , []byte (fixture ), 0o644 ))
152+
153+ provider , ok := NewProvider (AgentGeminiApps , ProviderConfig {})
154+ require .True (t , ok )
155+ exporter := provider .(GeminiAppsExportParser )
156+ var results []ParseResult
157+ summary , err := exporter .ParseGeminiAppsExport (path , func (result ParseResult ) error {
158+ results = append (results , result )
159+ return nil
160+ })
161+ assert .ErrorContains (t , err , "no admissible Prompted records" )
162+ assert .Empty (t , results )
163+ assert .Equal (t , 1 , summary .Errors )
164+ }
165+
146166func TestParseGeminiAppsTimestampMustBeInHeader (t * testing.T ) {
147167 fixture := strings .Replace (
148168 sanitizedGeminiAppsHTML ,
0 commit comments