![]() Server : Apache/2 System : Linux server-15-235-50-60 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64 User : gositeme ( 1004) PHP Version : 8.2.29 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname Directory : /home/gositeme/domains/lavocat.ca/public_html/scripts/ |
const fs = require('fs');
const path = require('path');
console.log('š ProfileInteractionPanel Verification Script');
console.log('==============================================\n');
// Check if ProfileInteractionPanel component exists
const componentPath = path.join(__dirname, '../src/components/ProfileInteractionPanel.tsx');
if (fs.existsSync(componentPath)) {
console.log('ā
ProfileInteractionPanel component found');
const componentContent = fs.readFileSync(componentPath, 'utf8');
// Check for required imports
const requiredImports = [
'useSession',
'framer-motion',
'lucide-react',
'react-hot-toast'
];
requiredImports.forEach(importName => {
if (componentContent.includes(importName)) {
console.log(`ā
${importName} import found`);
} else {
console.log(`ā ${importName} import missing`);
}
});
// Check for required API endpoints
const apiEndpoints = [
'/api/profile/[profileId]/stats',
'/api/profile/[profileId]/follow',
'/api/profile/[profileId]/endorse'
];
apiEndpoints.forEach(endpoint => {
if (componentContent.includes(endpoint.replace('[profileId]', '${profileId}'))) {
console.log(`ā
API endpoint ${endpoint} referenced`);
} else {
console.log(`ā API endpoint ${endpoint} not referenced`);
}
});
// Check for required functionality
const requiredFunctions = [
'handleFollow',
'handleEndorse',
'handleShare',
'fetchUserStats'
];
requiredFunctions.forEach(funcName => {
if (componentContent.includes(funcName)) {
console.log(`ā
${funcName} function found`);
} else {
console.log(`ā ${funcName} function missing`);
}
});
// Check for error handling
if (componentContent.includes('toast.error')) {
console.log('ā
Error handling with toast found');
} else {
console.log('ā Error handling missing');
}
// Check for loading states
if (componentContent.includes('loading') && componentContent.includes('disabled')) {
console.log('ā
Loading states found');
} else {
console.log('ā Loading states missing');
}
} else {
console.log('ā ProfileInteractionPanel component not found');
}
console.log('\nš Checking API endpoints...');
// Check if API endpoints exist
const apiEndpoints = [
'src/pages/api/profile/[profileId]/stats.ts',
'src/pages/api/profile/[profileId]/follow.ts',
'src/pages/api/profile/[profileId]/endorse.ts'
];
apiEndpoints.forEach(endpoint => {
const endpointPath = path.join(__dirname, '..', endpoint);
if (fs.existsSync(endpointPath)) {
console.log(`ā
${endpoint} exists`);
const endpointContent = fs.readFileSync(endpointPath, 'utf8');
// Check for auth import
if (endpointContent.includes('authOptions')) {
console.log(` ā
authOptions import found in ${endpoint}`);
} else {
console.log(` ā authOptions import missing in ${endpoint}`);
}
// Check for prisma import
if (endpointContent.includes('prisma')) {
console.log(` ā
prisma import found in ${endpoint}`);
} else {
console.log(` ā prisma import missing in ${endpoint}`);
}
} else {
console.log(`ā ${endpoint} not found`);
}
});
console.log('\nš§ Checking for common issues...');
// Check for TypeScript errors
const tsConfigPath = path.join(__dirname, '../tsconfig.json');
if (fs.existsSync(tsConfigPath)) {
console.log('ā
TypeScript config found');
} else {
console.log('ā TypeScript config missing');
}
// Check for test files
const testFiles = [
'tests/profile-interaction-panel.spec.ts',
'docs/profile-interaction-panel-qa-checklist.md'
];
testFiles.forEach(testFile => {
const testPath = path.join(__dirname, '..', testFile);
if (fs.existsSync(testPath)) {
console.log(`ā
${testFile} found`);
} else {
console.log(`ā ${testFile} missing`);
}
});
console.log('\nš Summary:');
console.log('===========');
console.log('1. Component verification: Check imports, functions, and error handling');
console.log('2. API endpoint verification: Check auth and prisma imports');
console.log('3. Test coverage: E2E tests and QA checklist created');
console.log('4. Next steps: Run manual QA checklist or automated tests');
console.log('\nš To run tests:');
console.log('npm run test:e2e -- tests/profile-interaction-panel.spec.ts');
console.log('\nš To use QA checklist:');
console.log('Open docs/profile-interaction-panel-qa-checklist.md');
console.log('\n⨠Verification complete!');