diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index 22030b3..fa12dff 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -26,3 +26,27 @@ jobs: - name: Run unit tests run: npm run test:run + + e2e-tests: + name: Run Playwright e2e tests + runs-on: ubuntu-latest + needs: unit-tests + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + cache-dependency-path: package-lock.json + + - name: Install dependencies + run: npm ci + + - name: Install Playwright browsers + run: npx playwright install --with-deps + + - name: Run e2e tests + run: npm run test:e2e + env: + CI: true diff --git a/app/existing/[repoUrl]/page.tsx b/app/existing/[repoUrl]/page.tsx index 7c9a7ab..a620ed2 100644 --- a/app/existing/[repoUrl]/page.tsx +++ b/app/existing/[repoUrl]/page.tsx @@ -7,13 +7,14 @@ import { absoluteUrl } from "@/lib/site-metadata" import type { RepoScanRouteParams } from "@/types/repo-scan" type RepoScanPageProps = { - params: RepoScanRouteParams + params: Promise } const toSlug = (repoUrl: string) => repoUrl.replace(/^https:\/\/github.com\//, "") -export function generateMetadata({ params }: RepoScanPageProps): Metadata { - const decoded = decodeRepoRouteParam(params.repoUrl) +export async function generateMetadata({ params }: RepoScanPageProps): Promise { + const resolvedParams = await params + const decoded = decodeRepoRouteParam(resolvedParams.repoUrl) const normalized = decoded ? normalizeGitHubRepoInput(decoded) ?? decoded : null const repoSlug = normalized ? toSlug(normalized) : null const title = repoSlug ? `Repo scan · ${repoSlug}` : "Repo scan" @@ -47,8 +48,9 @@ export function generateMetadata({ params }: RepoScanPageProps): Metadata { } } -export default function RepoScanPage({ params }: RepoScanPageProps) { - const decoded = decodeRepoRouteParam(params.repoUrl) +export default async function RepoScanPage({ params }: RepoScanPageProps) { + const resolvedParams = await params + const decoded = decodeRepoRouteParam(resolvedParams.repoUrl) const normalized = decoded ? normalizeGitHubRepoInput(decoded) ?? decoded : null return diff --git a/app/existing/[repoUrl]/repo-scan-client.tsx b/app/existing/[repoUrl]/repo-scan-client.tsx index 649cdf7..726b22b 100644 --- a/app/existing/[repoUrl]/repo-scan-client.tsx +++ b/app/existing/[repoUrl]/repo-scan-client.tsx @@ -148,7 +148,10 @@ export default function RepoScanClient({ initialRepoUrl }: RepoScanClientProps) }, [scanResult]) return ( -
+
) : promptVisible ? ( -
+

Scan {repoSlug ?? repoUrlForScan}?

We will detect languages, frameworks, tooling, and testing info.

- +
) : isLoading ? (
) : error ? ( -
+
) : scanResult ? ( -
+

Detected snapshot

@@ -291,7 +308,10 @@ export default function RepoScanClient({ initialRepoUrl }: RepoScanClientProps)

) : null} -
+

Raw response

                                         {JSON.stringify(scanResult, null, 2)}
diff --git a/app/existing/existing-repo-entry-client.tsx b/app/existing/existing-repo-entry-client.tsx
index 9aac144..ec785ca 100644
--- a/app/existing/existing-repo-entry-client.tsx
+++ b/app/existing/existing-repo-entry-client.tsx
@@ -34,7 +34,10 @@ export function ExistingRepoEntryClient() {
   }
 
   return (
-    
+