<?php

use App\Models\Announcement;
use App\Models\AnnouncementMedia;
use App\Models\PartnerMedia;
use Illuminate\Foundation\Testing\RefreshDatabase;

uses(RefreshDatabase::class);

test('announcement media relation works', function () {
    $announcement = Announcement::factory()->create();
    $media = PartnerMedia::factory()->create();
    $announcementMedia = AnnouncementMedia::factory()->create([
        'announcement_id' => $announcement->id,
        'partner_media_id' => $media->id,
    ]);

    expect($announcementMedia->announcement->id)->toBe($announcement->id);
    expect($announcementMedia->partnerMedia->id)->toBe($media->id);
});
