<?php

use App\Models\MediaMonitoringTheme;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Foundation\Testing\RefreshDatabase;

uses(RefreshDatabase::class);

describe('MediaMonitoringTheme Model', function () {
    it('can create a media monitoring theme pivot', function () {
        $pivot = MediaMonitoringTheme::factory()->create();

        expect($pivot->exists)->toBeTrue()
            ->and($pivot->media_monitoring_id)->toBeInt()
            ->and($pivot->theme_id)->toBeInt();
    });

    it('has guarded attributes', function () {
        $guarded = ['id'];

        expect(MediaMonitoringTheme::make()->getGuarded())->toEqual($guarded);
    });

    it('belongs to media monitoring', function () {
        $pivot = MediaMonitoringTheme::factory()->create();

        expect($pivot->mediaMonitoring())->toBeInstanceOf(BelongsTo::class);
    });

    it('belongs to theme', function () {
        $pivot = MediaMonitoringTheme::factory()->create();

        expect($pivot->theme())->toBeInstanceOf(BelongsTo::class);
    });
});
