Files
einundzwanzig-app/tests/Browser/SidebarNavigationTest.php
T
2026-06-26 21:10:02 +02:00

33 lines
874 B
PHP

<?php
use App\Models\City;
use App\Models\Country;
beforeEach(function () {
$country = Country::factory()->create(['code' => 'de']);
City::factory()->create(['country_id' => $country->id]);
});
it('renders the sidebar with the user profile reachable on mobile viewport', function () {
actingAsUser(['name' => 'Sidebar Tester']);
$page = visit('/de/dashboard');
$page->resize(390, 844)
->click('[data-test="sidebar-open"]')
->assertSee('Dashboard')
->assertSee('Repository')
->assertSee('Sidebar Tester');
});
it('renders the sidebar with the user profile on desktop viewport', function () {
actingAsUser(['name' => 'Sidebar Tester']);
$page = visit('/de/dashboard');
$page->resize(1280, 800)
->assertSee('Dashboard')
->assertSee('Repository')
->assertSee('Sidebar Tester');
});