fixed mobile
This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Browser;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||
use Laravel\Dusk\Browser;
|
||||
use Tests\DuskTestCase;
|
||||
|
||||
class WmsResponsiveNavigationTest extends DuskTestCase
|
||||
{
|
||||
use DatabaseMigrations;
|
||||
/**
|
||||
* Ensure the desktop sidebar remains visible and usable on large screens.
|
||||
*/
|
||||
public function test_desktop_sidebar_navigation_remains_unchanged(): void
|
||||
{
|
||||
$user = User::factory()->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');
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user