API testing tersedia di: /api/test-progress
fetch('/api/test-progress', { method: 'GET' })
.then(r => r.json())
.then(data => {
console.log(data.message);
alert(`${data.message}\n\nRefresh dashboard untuk melihat perubahan!`);
});fetch('/api/test-progress', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ minutes: 60 })
}).then(r => r.json()).then(data => alert(data.message));fetch('/api/test-progress', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ minutes: 120 })
}).then(r => r.json()).then(data => alert(data.message));fetch('/api/test-progress', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ minutes: 240 })
}).then(r => r.json()).then(data => alert(data.message));fetch('/api/test-progress', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ minutes: 360 })
}).then(r => r.json()).then(data => alert(data.message));fetch('/api/test-progress', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ minutes: 540 })
}).then(r => r.json()).then(data => alert(data.message));fetch('/api/test-progress', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ minutes: 720 })
}).then(r => r.json()).then(data => alert(data.message));fetch('/api/test-progress?level=5', { method: 'DELETE' })
.then(r => r.json())
.then(data => alert(data.message + '\n\nBadge: ' + data.data.badge));fetch('/api/test-progress?level=10', { method: 'DELETE' })
.then(r => r.json())
.then(data => alert(data.message + '\n\nBadge: ' + data.data.badge));fetch('/api/test-progress?level=13', { method: 'DELETE' })
.then(r => r.json())
.then(data => alert(data.message + '\n\nBadge: ' + data.data.badge));// 1. Reset
await fetch('/api/test-progress', { method: 'GET' }).then(r => r.json()).then(console.log);
await new Promise(r => setTimeout(r, 500));
// 2. Level 2 - Wibu Fomo
await fetch('/api/test-progress', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ minutes: 60 })
}).then(r => r.json()).then(data => console.log('Level 2:', data.badge));
await new Promise(r => setTimeout(r, 500));
// 3. Level 3 - Wibu Veteran
await fetch('/api/test-progress', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ minutes: 60 })
}).then(r => r.json()).then(data => console.log('Level 3:', data.badge));
await new Promise(r => setTimeout(r, 500));
// 4. Level 5 - Wibu Master
await fetch('/api/test-progress', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ minutes: 120 })
}).then(r => r.json()).then(data => console.log('Level 5:', data.badge));
await new Promise(r => setTimeout(r, 500));
// 5. Level 7 - Wibu Elite
await fetch('/api/test-progress', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ minutes: 120 })
}).then(r => r.json()).then(data => console.log('Level 7:', data.badge));
await new Promise(r => setTimeout(r, 500));
// 6. Level 10 - Wibu Legend
await fetch('/api/test-progress', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ minutes: 180 })
}).then(r => r.json()).then(data => console.log('Level 10:', data.badge));
await new Promise(r => setTimeout(r, 500));
// 7. Level 13 - Ota-King👑
await fetch('/api/test-progress', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ minutes: 180 })
}).then(r => r.json()).then(data => console.log('Level 13:', data.badge));
console.log('✅ Testing selesai! Refresh dashboard untuk melihat badge terakhir.');Level 1: 0 menit (0 jam) - Wibu Pemula
Level 2: 60 menit (1 jam) - Wibu Fomo
Level 3: 120 menit (2 jam) - Wibu Veteran
Level 5: 240 menit (4 jam) - Wibu Master
Level 7: 360 menit (6 jam) - Wibu Elite
Level 10: 540 menit (9 jam) - Wibu Legend
Level 13: 720 menit (12 jam) - Ota-King👑
fetch('/api/test-progress', { method: 'GET' }).then(() => {
return fetch('/api/test-progress', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ minutes: 240 })
});
}).then(r => r.json()).then(data => {
alert(`Setelah nonton 12 episode:\n${data.message}`);
});fetch('/api/test-progress', { method: 'GET' }).then(() => {
return fetch('/api/test-progress', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ minutes: 480 })
});
}).then(r => r.json()).then(data => {
alert(`Setelah nonton 24 episode:\n${data.message}`);
});fetch('/api/test-progress', { method: 'GET' }).then(() => {
return fetch('/api/test-progress', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ minutes: 720 })
});
}).then(r => r.json()).then(data => {
alert(`Setelah marathon 36 episode:\n${data.message}`);
});Jangan lupa hapus testing API sebelum push ke production:
# Hapus folder testing API
rm -rf src/app/api/test-progress
# Atau via Windows
Remove-Item -Path "src\app\api\test-progress" -Recurse -Force- Buka 2 tab: Satu untuk console commands, satu untuk dashboard
- Refresh dashboard setelah run command untuk lihat perubahan
- Check console untuk lihat response lengkap
- Test badge transition dengan increment kecil (60 menit = 1 level)
Happy Testing! 🎉