<?php

namespace Tests\Unit;

use App\Models\Room;
use App\Services\Meet\SpaceService;
use Tests\TestCase;

class SpaceServiceTest extends TestCase
{
    public function test_space_rooms_disallow_meeting_only_features(): void
    {
        $service = app(SpaceService::class);
        $space = new Room(['type' => 'space']);
        $meeting = new Room(['type' => 'meeting']);

        foreach (['breakouts', 'qa', 'polls', 'files', 'whiteboard', 'programme', 'live_stream', 'lock'] as $feature) {
            $this->assertFalse($service->allowsRoomFeature($space, $feature), $feature);
            $this->assertTrue($service->allowsRoomFeature($meeting, $feature), $feature);
        }

        $this->assertTrue($service->allowsRoomFeature($space, 'chat'));
        $this->assertTrue($service->allowsRoomFeature($meeting, 'chat'));
    }
}
