Initial commit: Brachnha Insight project setup
- Next.js 14+ with App Router and TypeScript - Tailwind CSS and ShadCN UI styling - Zustand state management - Dexie.js for IndexedDB (local-first data) - Auth.js v5 for authentication - BMAD framework integration Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
27
tests/integration/ghostwriter-persistence.test.ts
Normal file
27
tests/integration/ghostwriter-persistence.test.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
|
||||
test.describe('Ghostwriter Persistence', () => {
|
||||
test('Scenario 2.4.2 (P0): Session Saved as Completed', async ({ request }) => {
|
||||
// GIVEN: A chat session flow is completed
|
||||
// This is an API/Integration test, so we hit the endpoint directly if possible,
|
||||
// OR we use the service capability if we were in a unit test.
|
||||
// For Playwright Integration (API), we assume an endpoint exists to finalize.
|
||||
|
||||
// Setup: Create a session
|
||||
const createRes = await request.post('/api/sessions', { data: { title: 'Test Session' } });
|
||||
const { sessionId } = await createRes.json();
|
||||
|
||||
// WHEN: User saves the final draft
|
||||
const saveRes = await request.post(`/api/sessions/${sessionId}/finalize`, {
|
||||
data: { finalContent: 'My Lesson' }
|
||||
});
|
||||
expect(saveRes.status()).toBe(200);
|
||||
|
||||
// THEN: Session status is COMPLETED
|
||||
const getRes = await request.get(`/api/sessions/${sessionId}`);
|
||||
const session = await getRes.json();
|
||||
|
||||
expect(session.status).toBe('COMPLETED');
|
||||
expect(session.finalArtifact).toBe('My Lesson');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user