<?php

namespace Tests\Browser\Auth;

use App\Models\BackendAuth\BackendUser;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Support\Facades\Hash;
use Laravel\Dusk\Browser;
use Tests\Browser\Traits\AuthTrait;
use Tests\DuskTestCase;

class LogoutTest extends DuskTestCase
{
    use DatabaseMigrations;
    use AuthTrait;

    public function testShouldLogoutWithSuccess()
    {
        $this->browse(function (Browser $browser) {

            $this->loginToAdminBackend();

            $browser->visit('/admin/login')
                ->assertPathIs('/admin')
                ->assertSee('This is my body content.');

            $browser->click('#logout_lnk')
                ->assertPathIs('/admin/login');
        });
    }
}
