This guide explains how to use the provided test data to thoroughly test the MailVoid application functionality.
After your database is set up and migrations are applied, run the seed script:
# Connect to your MySQL database
mysql -u your_username -p your_database_name < seed_test_data.sqlOr using MySQL Workbench:
- Open MySQL Workbench
- Connect to your database
- Open the
seed_test_data.sqlfile - Execute the script
The script creates the following test accounts (password: password123 for all except admin):
| Username | Password | Role | Default Mailbox |
|---|---|---|---|
| admin | admin | Admin | admin@admin.mailvoid.com |
| john | password123 | User | *@john.mailvoid.com |
| jane | password123 | User | *@jane.mailvoid.com |
| manager | password123 | Admin | *@manager.mailvoid.com |
| alice | password123 | User | *@alice.mailvoid.com |
- Login with each test account
- Verify role-based access (admin vs user)
- Test password changes
- Test logout functionality
- Login as any user
- Go to "Manage Mailboxes" in Mail Settings
- Verify default mailbox shows "Default" badge
- Verify no "Release" button on default mailbox
- Try API call to unclaim default mailbox (should fail)
- support: Customer support emails (owned by manager)
- sales: Sales inquiries (owned by manager)
- marketing: Marketing campaigns (owned by jane)
- test: Testing emails (owned by john)
- dev: Development emails (owned by john, manager has access)
- Login as different users and verify which groups are visible
- Test group access permissions
- Try accessing emails in groups without permission
- Test group management (add/remove users, change settings)
- jane claimed:
newslettersubdomain - alice claimed:
personalsubdomain
-
unclaimedsubdomain -
availablesubdomain -
opensubdomain
- View claimed mailboxes (should show "Release" button)
- Successfully unclaim non-default mailboxes
- Claim available subdomains
- Verify emails move between groups when claiming/unclaiming
- View emails in different groups
- Test email filtering and search
- Test email deletion
- Test HTML vs text email rendering
- Check email timestamps and sorting
- Make an invalid API request
- Verify automatic logout and redirect to login
- Test with expired/invalid tokens
- Update group descriptions
- Change group visibility (public/private)
- Grant/revoke user access to groups
- Verify permission restrictions on private groups
The seed data creates emails distributed as follows:
| Mail Group | Email Count | Description |
|---|---|---|
| user-john | 3 | John's default mailbox |
| user-jane | 2 | Jane's default mailbox |
| user-jane | 2 | Jane's claimed newsletter emails |
| user-alice | 2 | Alice's claimed personal emails |
| support | 3 | Public support tickets |
| sales | 3 | Public sales inquiries |
| marketing | 2 | Public marketing emails |
| dev | 3 | Private development emails |
| test | 2 | Public test emails |
| unclaimed | 1 | Available for claiming |
| available | 1 | Available for claiming |
| open | 1 | Available for claiming |
- Login with any test account
- View emails in permitted groups
- Claim unclaimed subdomains
- Unclaim non-default mailboxes
- Admin users can manage all groups
- Users can manage their own groups
- Unclaiming default mailboxes
- Accessing private groups without permission
- Invalid login attempts
- Modifying groups owned by others (non-admin)
To reset the test data, simply run the seed script again. It includes cleanup statements at the beginning.
For API testing, you can use these endpoints with proper authentication:
# Get user's private mailboxes
GET /api/mail/my-mailboxes
# Try to unclaim default mailbox (should fail)
DELETE /api/mail/unclaim
Body: {"emailAddress": "anything@john.mailvoid.com"}
# Claim available subdomain
POST /api/mail/claim
Body: {"emailAddress": "test@unclaimed.mailvoid.com"}
# Check if email is claimed
GET /api/mail/check/test@unclaimed.mailvoid.comThis comprehensive test suite will help you verify all the functionality works correctly!