T.ME/BIBIL_0DAY
CasperSecurity


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/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/gositeme/domains/lavocat.ca/public_html/scripts/verify-profile-interaction.js
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!'); 

CasperSecurity Mini