# ContactImportView.vue Testing Guide

## Quick Testing Setup
- Web server running at: `http://localhost:3000`
- Migration completed: 2025-07-06
- Component: `src/views/ContactImportView.vue`

## Test URLs (Copy/Paste into Browser)

### 1. Basic Page Load
```
http://localhost:3000/contact-import
```
**Expected**: Manual JWT input page loads

### 2. Single Contact Import
```
http://localhost:3000/contact-import?contacts=[{"did":"did:test:123","name":"Test User"}]
```
**Expected**: "Test User" appears in import list

### 3. Multiple Contacts Import
```
http://localhost:3000/contact-import?contacts=[{"did":"did:test:alice","name":"Alice"},{"did":"did:test:bob","name":"Bob"}]
```
**Expected**: Both contacts appear in import list

### 4. Malformed Data Test
Navigate to basic page and paste this into textarea:
```
[{"invalid":"data","missing":"did"}]
```
**Expected**: Error message displays

## Browser Developer Tools Validation

### Console Tab
- Check for errors during page load
- Verify error logging works (test malformed data)
- Look for properly formatted log messages

### Application Tab
- Navigate to: IndexedDB → TimeSafari
- Check `contacts` table for imported contacts
- Check `logs` table for error entries

### Network Tab
- Monitor API calls during import
- Verify visibility setting API calls (if enabled)

## Testing Checklist

### Web Platform (Chrome) ✅/❌
- [ ] Basic page loads without errors
- [ ] Single contact import works
- [ ] Multiple contacts import works
- [ ] Database operations work (check IndexedDB)
- [ ] Error handling works (malformed data)
- [ ] Logging works (console + database)
- [ ] Visibility setting works
- [ ] Duplicate detection works

### Expected Database Operations
- **Insert**: New contacts added to contacts table
- **Update**: Existing contacts updated if imported again
- **Logging**: Errors recorded in logs table
- **Persistence**: Data survives page refresh

### Success Criteria
- ✅ No console errors during normal operation
- ✅ Contacts successfully imported and visible in contacts list
- ✅ Error scenarios handled gracefully
- ✅ Database operations work correctly
- ✅ Logging functions as expected

## Notes
- Test both with and without existing contacts
- Verify redirect to contacts page after import
- Check success/error notifications display
- Validate contact data structure in database 