File: /home/xedaptot/ai.naniguide.com/tests/Feature/MailListModelFeatureTest.php
<?php
/**
* MailList model feature tests.
*
* Tests list model behavior, required fields, and configuration options.
*/
use App\Model\MailList;
test('mail list model accepts attributes', function () {
$list = new MailList([
'name' => 'Newsletter Subscribers',
'from_email' => '[email protected]',
'from_name' => 'Newsletter Team',
]);
expect($list->name)->toBe('Newsletter Subscribers');
expect($list->from_email)->toBe('[email protected]');
expect($list->from_name)->toBe('Newsletter Team');
});
test('mail list has required fillable fields', function () {
$list = new MailList();
$fillable = $list->getFillable();
expect($fillable)->toContain('name');
expect($fillable)->toContain('from_email');
expect($fillable)->toContain('from_name');
});
test('mail list notification options are fillable', function () {
$list = new MailList();
$fillable = $list->getFillable();
expect($fillable)->toContain('send_welcome_email');
expect($fillable)->toContain('subscribe_confirmation');
expect($fillable)->toContain('unsubscribe_notification');
});