import sys
sys.path.append(r'E:\timesheet\timesheet_new\backend')

from activity_categorizer import ActivityCategorizer

# Test the categorizer
categorizer = ActivityCategorizer()

# Test cases that were showing in wrong categories
test_cases = [
    ("Untitled", "Unknown"),
    ("Inbox (11,928) - ankita@firsteconomy.com - First Economy Mail", "chrome.exe"),
    ("Claude", "claude.exe"),
    ("Dashboard - WAAREE Admin", "chrome.exe"),
    ("Timesheet App", "chrome.exe"),
    ("waaree_main - live@waaree.com@103.174.103.109 - FileZilla", "filezilla.exe"),
]

print("Testing categorization fixes:\n" + "="*50)
for title, app in test_cases:
    category_info = categorizer.get_detailed_category(title, app)
    print(f"\n{title} | {app}")
    print(f"→ Category: {category_info['category']} ({category_info['subcategory']})")
    print(f"   Expected: {'non-work' if 'Untitled' in title else 'browser' if '@' in title or 'Inbox' in title else 'productive'}")
    
print("\n" + "="*50)
print("✅ Untitled should be → non-work")
print("✅ Email/Inbox should be → browser")
print("✅ Claude, Dashboard, etc should be → productive")
