From 9569718c8fd1ef546bdb8fa225c85185a2359c05 Mon Sep 17 00:00:00 2001 From: JohnDoe6345789 Date: Fri, 26 Dec 2025 01:15:19 +0000 Subject: [PATCH] code: tsx,nextjs,frontends (2 files) --- frontends/nextjs/src/app/codegen/CodegenStudioClient.tsx | 8 +++++++- .../src/components/level5/PowerTransferTab.test.tsx | 6 +++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/frontends/nextjs/src/app/codegen/CodegenStudioClient.tsx b/frontends/nextjs/src/app/codegen/CodegenStudioClient.tsx index c954720e7..9d5ea2849 100644 --- a/frontends/nextjs/src/app/codegen/CodegenStudioClient.tsx +++ b/frontends/nextjs/src/app/codegen/CodegenStudioClient.tsx @@ -1,5 +1,6 @@ 'use client' +import type { CodegenManifest } from '@/lib/codegen/codegen-types' import { useMemo, useState, type ChangeEvent } from 'react' import { @@ -63,7 +64,11 @@ const fetchZip = async (values: FormState) => { const blob = await response.blob() const filename = createFilename(response.headers.get('content-disposition'), `${values.projectName}.zip`) downloadBlob(blob, filename) - return filename + const manifestHeader = response.headers.get('x-codegen-manifest') + const manifest = manifestHeader + ? (JSON.parse(decodeURIComponent(manifestHeader)) as CodegenManifest) + : null + return { filename, manifest } } export default function CodegenStudioClient() { @@ -71,6 +76,7 @@ export default function CodegenStudioClient() { const [status, setStatus] = useState('idle') const [message, setMessage] = useState(null) const [error, setError] = useState(null) + const [manifest, setManifest] = useState(null) const runtimeDescription = useMemo(() => { switch (form.runtime) { diff --git a/frontends/nextjs/src/components/level5/PowerTransferTab.test.tsx b/frontends/nextjs/src/components/level5/PowerTransferTab.test.tsx index 16d27f4fb..52e4470cf 100644 --- a/frontends/nextjs/src/components/level5/PowerTransferTab.test.tsx +++ b/frontends/nextjs/src/components/level5/PowerTransferTab.test.tsx @@ -64,9 +64,9 @@ describe('PowerTransferTab', () => { renderComponent() await waitFor(() => expect(fetchMock).toHaveBeenCalled()) - expect(await screen.findByText(/Recent transfers/i)).toBeInTheDocument() - expect(screen.getByText(/Transfer to target-god/i)).toBeInTheDocument() - expect(screen.getByText(/Requested by supergod/i)).toBeInTheDocument() + await screen.findByText(/Recent transfers/i) + expect(screen.getByText(/Transfer to target-god/i)).toBeDefined() + expect(screen.getByText(/Requested by supergod/i)).toBeDefined() }) it('fires onInitiateTransfer when a user card is clicked', async () => {