<?php

namespace Tests\Feature;

use App\Livewire\Help\Index;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Livewire\Livewire;
use Tests\TestCase;

class HelpWireguardTopicTest extends TestCase
{
    use RefreshDatabase;

    protected function setUp(): void
    {
        parent::setUp();
        $this->actingAs(User::factory()->create(['must_change_password' => false]));
    }

    public function test_wireguard_is_a_known_topic_and_renders(): void
    {
        Livewire::test(Index::class, ['topic' => 'wireguard'])
            ->assertSet('topic', 'wireguard')
            ->assertSee('WireGuard');
    }

    public function test_wireguard_label_exists_in_both_locales(): void
    {
        $this->assertSame('WireGuard-Zugang', __('help.topic_wireguard', [], 'de'));
        $this->assertSame('WireGuard access', __('help.topic_wireguard', [], 'en'));
    }
}
