@@ -148,7 +148,10 @@ export default function RepoScanClient({ initialRepoUrl }: RepoScanClientProps)
148148 } , [ scanResult ] )
149149
150150 return (
151- < div className = "relative flex min-h-screen flex-col bg-background text-foreground" >
151+ < div
152+ className = "relative flex min-h-screen flex-col bg-background text-foreground"
153+ data-testid = "repo-scan-page"
154+ >
152155 < div className = "absolute inset-0 bg-gradient-to-b from-background via-background/95 to-background" aria-hidden = "true" />
153156 < header className = "relative z-10 flex items-center justify-between px-6 py-6 lg:px-12 lg:py-8" >
154157 < Link href = "/" className = "text-sm font-semibold text-foreground transition hover:text-primary" >
@@ -178,28 +181,42 @@ export default function RepoScanClient({ initialRepoUrl }: RepoScanClientProps)
178181 </ div >
179182 </ div >
180183 ) : promptVisible ? (
181- < div className = "space-y-4" >
184+ < div className = "space-y-4" data-testid = "repo-scan-prompt" >
182185 < h3 className = "text-xl font-semibold text-foreground" > Scan { repoSlug ?? repoUrlForScan } ?</ h3 >
183186 < p className = "text-sm text-muted-foreground" > We will detect languages, frameworks, tooling, and testing info.</ p >
184- < Button onClick = { handleStartScan } className = "w-full sm:w-auto" > Yes, scan this repo</ Button >
187+ < Button
188+ onClick = { handleStartScan }
189+ className = "w-full sm:w-auto"
190+ data-testid = "repo-scan-confirm-button"
191+ >
192+ Yes, scan this repo
193+ </ Button >
185194 </ div >
186195 ) : isLoading ? (
187196 < div className = "flex justify-center py-16" >
188197 < RepoScanLoader />
189198 </ div >
190199 ) : error ? (
191- < div className = "flex flex-col items-center gap-3 py-10 text-center" >
200+ < div
201+ className = "flex flex-col items-center gap-3 py-10 text-center"
202+ data-testid = "repo-scan-error"
203+ >
192204 < AlertTriangle className = "size-8 text-destructive" aria-hidden = "true" />
193205 < div >
194206 < p className = "text-base font-semibold text-foreground" > Unable to scan repository</ p >
195207 < p className = "mt-1 text-sm text-muted-foreground" > { error } </ p >
196208 </ div >
197209 { canRetry ? (
198- < Button onClick = { handleRetryScan } > Try again</ Button >
210+ < Button
211+ onClick = { handleRetryScan }
212+ data-testid = "repo-scan-retry-button"
213+ >
214+ Try again
215+ </ Button >
199216 ) : null }
200217 </ div >
201218 ) : scanResult ? (
202- < div className = "space-y-8" >
219+ < div className = "space-y-8" data-testid = "repo-scan-results" >
203220 < section className = "space-y-2" >
204221 < h3 className = "text-lg font-semibold text-foreground" > Detected snapshot</ h3 >
205222 < p className = "text-sm text-muted-foreground" >
@@ -291,7 +308,10 @@ export default function RepoScanClient({ initialRepoUrl }: RepoScanClientProps)
291308 </ div >
292309 </ div >
293310 ) : null }
294- < div className = "rounded-2xl border border-border/60 bg-background/70 p-5" >
311+ < div
312+ className = "rounded-2xl border border-border/60 bg-background/70 p-5"
313+ data-testid = "repo-scan-raw-json"
314+ >
295315 < h3 className = "text-sm font-semibold uppercase tracking-wide text-muted-foreground" > Raw response</ h3 >
296316 < pre className = "mt-3 max-h-72 overflow-auto rounded-md bg-muted p-3 text-xs text-muted-foreground" >
297317 { JSON . stringify ( scanResult , null , 2 ) }
0 commit comments