![]() 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.quebec/private_html/scripts/ |
const fs = require('fs');
const path = require('path');
console.log('š Testing EnhancedShareButton Integrations\n');
// Test 1: Check LiveCaseFeed integration
console.log('1. Checking LiveCaseFeed integration...');
const liveCaseFeedPath = path.join(__dirname, '..', 'src', 'components', 'LiveCaseFeed.tsx');
if (fs.existsSync(liveCaseFeedPath)) {
const content = fs.readFileSync(liveCaseFeedPath, 'utf8');
if (content.includes('import EnhancedShareButton') && content.includes('EnhancedShareButton')) {
console.log('ā
EnhancedShareButton integrated into LiveCaseFeed');
} else {
console.log('ā EnhancedShareButton not found in LiveCaseFeed');
}
} else {
console.log('ā LiveCaseFeed.tsx not found');
}
// Test 2: Check profile page integration
console.log('\n2. Checking profile page integration...');
const profilePath = path.join(__dirname, '..', 'src', 'pages', 'profile', '[username].tsx');
if (fs.existsSync(profilePath)) {
const content = fs.readFileSync(profilePath, 'utf8');
if (content.includes('import EnhancedShareButton') && content.includes('EnhancedShareButton')) {
console.log('ā
EnhancedShareButton integrated into profile page');
} else {
console.log('ā EnhancedShareButton not found in profile page');
}
} else {
console.log('ā Profile page not found');
}
// Test 3: Check EnhancedShareButton component exists
console.log('\n3. Checking EnhancedShareButton component...');
const shareButtonPath = path.join(__dirname, '..', 'src', 'components', 'EnhancedShareButton.tsx');
if (fs.existsSync(shareButtonPath)) {
const content = fs.readFileSync(shareButtonPath, 'utf8');
if (content.includes('useSocialShare') && content.includes('shareToFacebook')) {
console.log('ā
EnhancedShareButton component exists with social sharing functionality');
} else {
console.log('ā ļø EnhancedShareButton component exists but may have issues');
}
} else {
console.log('ā EnhancedShareButton component not found');
}
// Test 4: Check useSocialShare hook exists
console.log('\n4. Checking useSocialShare hook...');
const hookPath = path.join(__dirname, '..', 'src', 'hooks', 'useSocialShare.ts');
if (fs.existsSync(hookPath)) {
const content = fs.readFileSync(hookPath, 'utf8');
if (content.includes('shareToFacebook') && content.includes('shareToTwitter')) {
console.log('ā
useSocialShare hook exists with all social platforms');
} else {
console.log('ā ļø useSocialShare hook exists but may have issues');
}
} else {
console.log('ā useSocialShare hook not found');
}
// Test 5: Check CaseDetail integration (from earlier)
console.log('\n5. Checking CaseDetail integration...');
const caseDetailPath = path.join(__dirname, '..', 'src', 'components', 'CaseDetail.tsx');
if (fs.existsSync(caseDetailPath)) {
const content = fs.readFileSync(caseDetailPath, 'utf8');
if (content.includes('import EnhancedShareButton') && content.includes('EnhancedShareButton')) {
console.log('ā
EnhancedShareButton integrated into CaseDetail');
} else {
console.log('ā EnhancedShareButton not found in CaseDetail');
}
} else {
console.log('ā CaseDetail.tsx not found');
}
console.log('\nš Integration Test Complete!');
console.log('\nš Summary:');
console.log('- Live Cases Feed: Share buttons on case cards');
console.log('- User Profiles: Share buttons on profile pages');
console.log('- Case Details: Enhanced share functionality');
console.log('- All platforms: Facebook, Twitter, LinkedIn, WhatsApp, Copy');
console.log('\nš Ready for testing!');