diff --git a/package.json b/package.json index dc9f50c..612eea2 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "keygen": "bun run src/lib/federation/keygen.ts", "test:key": "cross-env NODE_ENV=test playwright test tests/key.test.ts", "test:discover": "cross-env NODE_ENV=test playwright test tests/discover.test.ts", + "test:attacks": "cross-env NODE_ENV=test playwright test tests/attacks.test.ts", "build": "next build", "start": "cross-env NODE_ENV=production node src/server.ts", "db:push": "drizzle-kit push", diff --git a/playwright.config.ts b/playwright.config.ts index 7100f36..fe473a3 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -25,13 +25,5 @@ export default defineConfig({ name: 'chromium', use: { ...devices['Desktop Chrome'] }, }, - { - name: 'firefox', - use: { ...devices['Desktop Firefox'] }, - }, - { - name: 'webkit', - use: { ...devices['Desktop Safari'] }, - }, ], }); diff --git a/src/app/PostTestForm.tsx b/src/app/PostTestForm.tsx new file mode 100644 index 0000000..6fcbc8f --- /dev/null +++ b/src/app/PostTestForm.tsx @@ -0,0 +1,90 @@ +"use client"; + +import { authClient } from "@/lib/auth-client"; +import { useState } from "react"; + +export function PostTestForm() { + const [text, setText] = useState(""); + const [files, setFiles] = useState([]); + const [status, setStatus] = useState(null); + + const handleSubmit = async () => { + setStatus("Submitting..."); + try { + const content: { type: "text" | "image"; value: string | File }[] = []; + + if (text.trim()) { + content.push({ type: "text", value: text.trim() }); + } + + for (const file of files) { + content.push({ type: "image", value: file }); + } + + if (content.length === 0) { + setStatus("Add some text or images first."); + return; + } + + const result = await authClient.createPost(content); + setStatus(`Done: ${JSON.stringify(result)}`); + } catch (err) { + setStatus(`Error: ${err instanceof Error ? err.message : String(err)}`); + } + }; + + return ( +
+

Test Post

+ +