mpbaPlatformAdmin()->create(); $this->browse(function (Browser $browser) use ($user): void { $browser->loginAs($user) ->resize(1440, 1000) ->visitRoute('platform.dashboard') ->assertSee('Platform Dashboard') ->assertSee('Analytics') ->assertSee('Inventory') ->clickLink('Inventory') ->assertRouteIs('inventory-management.index') ->assertSee('Inventory Management'); }); } /** * Ensure the mobile menu hamburger opens the slide-out navigation. */ public function test_mobile_menu_opens_slide_out_navigation(): void { $user = User::factory()->mpbaPlatformAdmin()->create(); $this->browse(function (Browser $browser) use ($user): void { $browser->loginAs($user) ->resize(390, 844) ->visitRoute('platform.dashboard') ->assertSee('Platform Dashboard') ->assertPresent('[data-wms-mobile-open]') ->click('[data-wms-mobile-open]') ->pause(150) ->assertAttribute('[data-wms-mobile-open]', 'aria-expanded', 'true') ->assertPresent('[data-wms-sidebar]') ->assertSee('Platform') ->clickLink('Shipping') ->assertRouteIs('shipping.index') ->assertSee('Shipping'); }); } /** * Ensure the mobile overlay closes the menu without affecting desktop navigation. */ public function test_mobile_menu_overlay_closes_drawer(): void { $user = User::factory()->mpbaPlatformAdmin()->create(); $this->browse(function (Browser $browser) use ($user): void { $browser->loginAs($user) ->resize(414, 896) ->visitRoute('platform.dashboard') ->click('[data-wms-mobile-open]') ->pause(150) ->assertAttribute('[data-wms-mobile-open]', 'aria-expanded', 'true') ->click('[data-wms-mobile-close]') ->pause(150) ->assertAttribute('[data-wms-mobile-open]', 'aria-expanded', 'false'); }); } }