29 lines
833 B
PHP
29 lines
833 B
PHP
<?php
|
|
|
|
namespace Tests\Feature\Auth;
|
|
|
|
use App\Models\User;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
use Tests\TestCase;
|
|
|
|
/** Akun demo (provider users) tidak punya hak akses ganda sungguhan: pemilih peran tetap prototipe. */
|
|
class RoleSwitchDemoTest extends TestCase
|
|
{
|
|
use RefreshDatabase;
|
|
|
|
public function test_demo_accounts_cannot_use_the_real_switch(): void
|
|
{
|
|
$this->actingAs(User::factory()->dosen()->create())
|
|
->post(route('peran.ganti'), ['role' => 'mahasiswa'])
|
|
->assertNotFound();
|
|
}
|
|
|
|
public function test_demo_menu_still_shows_the_prototype_notice(): void
|
|
{
|
|
$this->actingAs(User::factory()->dosen()->create())
|
|
->get(route('dosen.dashboard'))
|
|
->assertOk()
|
|
->assertSee('belum aktif pada tampilan prototipe');
|
|
}
|
|
}
|