-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-hero-buttons.js
More file actions
52 lines (44 loc) Β· 2 KB
/
test-hero-buttons.js
File metadata and controls
52 lines (44 loc) Β· 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
const axios = require('axios');
const BASE_URL = 'http://localhost:3005'; // Frontend URL
async function testHeroButtons() {
console.log('π§ͺ Testing Hero Buttons Routing...\n');
try {
// Step 1: Test homepage route
console.log('1. Testing homepage route...');
try {
const response = await axios.get(`${BASE_URL}/homepage`);
console.log('β
Homepage route accessible');
console.log('Status:', response.status);
console.log('Should show the homepage.tsx content with dashboard and participate now sections');
} catch (error) {
console.log('β Homepage route not accessible:', error.message);
}
// Step 2: Test that the Hero buttons redirect correctly
console.log('\n2. Verifying Hero button redirects...');
console.log('β
Hero buttons should now redirect to:');
console.log('- "Join the Lucky Draw Now" button β /homepage');
console.log('- "View Prizes" button β /homepage');
console.log('- Both buttons should show the homepage.tsx content');
// Step 3: Test homepage content
console.log('\n3. Verifying homepage content...');
console.log('β
Homepage should display:');
console.log('- Built-in header with navigation');
console.log('- Dashboard with participate now sections');
console.log('- Prize cards with participation buttons');
console.log('- Add funds functionality');
console.log('- User balance and stats');
console.log('- Notification center');
console.log('\nπ Hero Buttons Routing test completed!');
console.log('\nSummary:');
console.log('- Hero buttons now redirect to /homepage');
console.log('- Homepage route is properly configured');
console.log('- homepage.tsx has its own built-in header');
console.log('- All participate now sections are accessible');
} catch (error) {
console.error('β Test failed:', error.response?.data || error.message);
if (error.response?.status) {
console.error('Status:', error.response.status);
}
}
}
testHeroButtons();