File: /home/xedaptot/ai.naniguide.com/tests/Feature/AdMetricFeatureTest.php
<?php
use App\Model\AdMetric;
test('ad metric fillable fields are correct', function () {
$metric = new AdMetric();
expect($metric->getFillable())->toContain('ad_campaign_id', 'platform', 'date', 'impressions', 'clicks', 'spend', 'conversions', 'ctr', 'cpc', 'cpm', 'roas', 'custom');
});
test('ad metric casts are correct', function () {
$metric = new AdMetric();
$casts = $metric->getCasts();
expect($casts['date'])->toBe('date');
expect($casts['impressions'])->toBe('integer');
expect($casts['clicks'])->toBe('integer');
expect($casts['spend'])->toBe('decimal:2');
expect($casts['ctr'])->toBe('decimal:4');
expect($casts['custom'])->toBe('json');
});