/**
* Test fixtures for session notes
*/
import type { SessionNote } from '../types/session.js';
/**
* Simple session note with minimal data
*/
export const simpleNote: SessionNote = {
summary: 'Fixed a typo in README',
timestamp: '2024-01-15T10:30:00Z',
};
/**
* Complex session note with full data
*/
export const complexNote: SessionNote = {
summary: 'Implemented user authentication with OAuth2',
timestamp: '2024-01-20T14:45:00Z',
projectName: 'my-app',
topic: 'OAuth2 Authentication',
tags: ['authentication', 'oauth2', 'security', 'typescript'],
workingDirectory: '/home/user/projects/my-app',
commands: [
{ command: 'pnpm install passport passport-oauth2', description: 'Install OAuth dependencies' },
{ command: 'pnpm run build', description: 'Build project' },
{ command: 'pnpm test', description: 'Run tests' },
],
fileChanges: [
{ path: 'src/auth/oauth.ts', type: 'created', description: 'OAuth2 provider implementation' },
{ path: 'src/auth/middleware.ts', type: 'created', description: 'Auth middleware' },
{ path: 'src/routes/auth.ts', type: 'modified', description: 'Add OAuth routes' },
{ path: 'package.json', type: 'modified', description: 'Add dependencies' },
{ path: '.env.example', type: 'modified', description: 'Add OAuth config vars' },
],
codeSnippets: [
{
language: 'typescript',
code: `export const oauthConfig = {
clientID: process.env.OAUTH_CLIENT_ID,
clientSecret: process.env.OAUTH_CLIENT_SECRET,
callbackURL: '/auth/callback',
};`,
description: 'OAuth configuration',
filePath: 'src/auth/oauth.ts',
},
],
analysis: {
pattern: 'new-feature',
patternConfidence: 85,
complexity: 'moderate',
fileCount: 2,
keyFiles: ['src/auth/oauth.ts', 'src/auth/middleware.ts'],
},
};
/**
* Bug fix session note
*/
export const bugFixNote: SessionNote = {
summary: 'Fixed null pointer exception in user profile',
timestamp: '2024-01-18T09:15:00Z',
projectName: 'my-app',
topic: 'Profile Bug Fix',
tags: ['bug', 'profile', 'null-check'],
commands: [
{ command: 'pnpm test -- --grep "profile"', description: 'Run profile tests' },
],
fileChanges: [
{ path: 'src/components/Profile.tsx', type: 'modified', description: 'Add null checks' },
],
analysis: {
pattern: 'bug-fix',
patternConfidence: 90,
complexity: 'simple',
fileCount: 20,
keyFiles: [],
},
};
/**
* Refactoring session note
*/
export const refactoringNote: SessionNote = {
summary: 'Refactored database queries to use repository pattern',
timestamp: '2024-01-22T11:00:00Z',
projectName: 'backend-api',
topic: 'Repository Pattern',
tags: ['refactoring', 'database', 'architecture', 'typescript'],
commands: [
{ command: 'pnpm run build', description: 'Build' },
{ command: 'pnpm test', description: 'Run tests' },
],
fileChanges: [
{ path: 'src/repositories/UserRepository.ts', type: 'created', description: 'User repository' },
{ path: 'src/repositories/BaseRepository.ts', type: 'created', description: 'Base repository' },
{ path: 'src/services/UserService.ts', type: 'modified', description: 'Use repository' },
{ path: 'src/services/OrderService.ts', type: 'modified', description: 'Use repository' },
],
analysis: {
pattern: 'refactoring',
patternConfidence: 95,
complexity: 'moderate',
fileCount: 50,
keyFiles: [],
},
};
/**
* Documentation session note
*/
export const documentationNote: SessionNote = {
summary: 'Added API documentation with OpenAPI spec',
timestamp: '2024-01-19T16:30:00Z',
projectName: 'backend-api',
topic: 'API Documentation',
tags: ['documentation', 'openapi', 'swagger'],
commands: [
{ command: 'pnpm run docs:generate', description: 'Generate API docs' },
],
fileChanges: [
{ path: 'docs/openapi.yaml', type: 'created', description: 'OpenAPI spec' },
{ path: 'README.md', type: 'modified', description: 'Add API section' },
],
analysis: {
pattern: 'documentation',
patternConfidence: 92,
complexity: 'simple',
fileCount: 25,
keyFiles: [],
},
};
/**
* Configuration session note
*/
export const configNote: SessionNote = {
summary: 'Configured CI/CD pipeline with GitHub Actions',
timestamp: '2024-01-21T08:00:00Z',
projectName: 'my-app',
topic: 'CI/CD Setup',
tags: ['ci-cd', 'github-actions', 'devops'],
commands: [
{ command: 'git push origin feature/ci-cd', description: 'Push CI config' },
],
fileChanges: [
{ path: '.github/workflows/ci.yml', type: 'created', description: 'CI workflow' },
{ path: '.github/workflows/deploy.yml', type: 'created', description: 'Deploy workflow' },
],
analysis: {
pattern: 'configuration',
patternConfidence: 88,
complexity: 'moderate',
fileCount: 40,
keyFiles: [],
},
};
/**
* Testing session note
*/
export const testingNote: SessionNote = {
summary: 'Added unit tests for payment service',
timestamp: '2024-01-23T13:20:00Z',
projectName: 'backend-api',
topic: 'Payment Tests',
tags: ['testing', 'unit-tests', 'jest', 'payment'],
commands: [
{ command: 'pnpm test -- --coverage', description: 'Run tests with coverage' },
],
fileChanges: [
{ path: 'src/services/__tests__/PaymentService.test.ts', type: 'created', description: 'Payment tests' },
{ path: 'src/services/__tests__/__mocks__/stripe.ts', type: 'created', description: 'Stripe mock' },
],
analysis: {
pattern: 'testing',
patternConfidence: 94,
complexity: 'moderate',
fileCount: 35,
keyFiles: [],
},
};
/**
* Note with empty/minimal fields for edge case testing
*/
export const minimalNote: SessionNote = {
summary: 'Quick fix',
timestamp: '2024-01-10T00:00:00Z',
};
/**
* Note with many changes for complexity testing
*/
export const manyTagsNote: SessionNote = {
summary: 'Large feature implementation with extensive changes',
timestamp: '2024-01-25T10:00:00Z',
projectName: 'my-app',
tags: ['typescript', 'react', 'redux', 'testing', 'api', 'authentication', 'database', 'caching'],
commands: [
{ command: 'pnpm install' },
{ command: 'pnpm run build' },
{ command: 'pnpm test' },
{ command: 'pnpm run lint' },
{ command: 'pnpm run typecheck' },
{ command: 'docker compose up' },
{ command: 'kubectl apply -f deployment.yaml' },
{ command: 'pnpm run e2e' },
{ command: 'pnpm run migrate' },
{ command: 'pnpm run seed' },
{ command: 'git push origin main' },
],
fileChanges: [
{ path: 'src/auth/oauth.ts', type: 'created' },
{ path: 'src/auth/middleware.ts', type: 'created' },
{ path: 'src/api/users.ts', type: 'created' },
{ path: 'src/api/products.ts', type: 'created' },
{ path: 'src/db/models/user.ts', type: 'created' },
{ path: 'src/db/models/product.ts', type: 'created' },
{ path: 'src/components/Dashboard.tsx', type: 'created' },
{ path: 'src/components/Profile.tsx', type: 'created' },
{ path: 'src/redux/authSlice.ts', type: 'created' },
{ path: 'src/redux/userSlice.ts', type: 'created' },
{ path: 'package.json', type: 'modified' },
{ path: 'tsconfig.json', type: 'modified' },
],
codeSnippets: [
{
language: 'typescript',
code: `
// Large code snippet representing complex implementation
export class AuthService {
private tokenManager: TokenManager;
private userRepository: UserRepository;
constructor(deps: AuthDependencies) {
this.tokenManager = deps.tokenManager;
this.userRepository = deps.userRepository;
}
async authenticate(credentials: Credentials): Promise<AuthResult> {
const user = await this.userRepository.findByEmail(credentials.email);
if (!user) throw new AuthError('User not found');
const isValid = await this.verifyPassword(credentials.password, user.passwordHash);
if (!isValid) throw new AuthError('Invalid password');
const tokens = await this.tokenManager.generateTokenPair(user);
return { user, tokens };
}
}`.repeat(3),
},
],
analysis: {
pattern: 'new-feature',
patternConfidence: 90,
complexity: 'complex',
fileCount: 85,
keyFiles: [],
},
};
/**
* Collection of all test notes
*/
export const allTestNotes: SessionNote[] = [
simpleNote,
complexNote,
bugFixNote,
refactoringNote,
documentationNote,
configNote,
testingNote,
minimalNote,
manyTagsNote,
];