Repo rebuild
This commit is contained in:
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Browser;
|
||||
|
||||
use Laravel\Dusk\Browser;
|
||||
use Tests\Browser\Concerns\InteractsWithWmsBrowser;
|
||||
use Tests\Browser\Concerns\InteractsWithWmsData;
|
||||
use Tests\DuskTestCase;
|
||||
|
||||
class MobileNavigationBrowserTest extends DuskTestCase
|
||||
{
|
||||
use InteractsWithWmsBrowser;
|
||||
use InteractsWithWmsData;
|
||||
|
||||
public function test_mobile_hamburger_opens_and_closes_professional_drawer(): void
|
||||
{
|
||||
$admin = $this->platformAdminUser();
|
||||
|
||||
$this->browse(function (Browser $browser) use ($admin): void {
|
||||
$browser->loginAs($admin)
|
||||
->resize(390, 844)
|
||||
->visit('/admin')
|
||||
->waitFor('[data-dusk="page-ready"]')
|
||||
->assertSee('Platform')
|
||||
->assertScript('document.documentElement.scrollWidth <= document.documentElement.clientWidth + 1');
|
||||
|
||||
$this->openMobileNavigation($browser);
|
||||
$browser->assertSourceHas('Platform');
|
||||
$this->closeMobileNavigation($browser);
|
||||
});
|
||||
}
|
||||
|
||||
public function test_mobile_drawer_navigates_to_major_menu_groups(): void
|
||||
{
|
||||
$admin = $this->platformAdminUser();
|
||||
$this->seedPlatformDashboardData();
|
||||
|
||||
$paths = [
|
||||
'/analytics' => 'Analytics',
|
||||
'/inventory-management' => 'Inventory',
|
||||
'/document-archive' => '',
|
||||
'/warehouses' => 'Warehouses',
|
||||
'/admin/prices' => '',
|
||||
];
|
||||
|
||||
$this->browse(function (Browser $browser) use ($admin, $paths): void {
|
||||
$browser->loginAs($admin)
|
||||
->resize(390, 844)
|
||||
->visit('/admin')
|
||||
->waitFor('[data-dusk="page-ready"]');
|
||||
|
||||
foreach ($paths as $path => $title) {
|
||||
$this->openMobileNavigation($browser);
|
||||
$this->clickSidebarHref($browser, $path);
|
||||
$this->assertSingleProfessionalHeader($browser, $title);
|
||||
$browser->assertScript('document.documentElement.scrollWidth <= document.documentElement.clientWidth + 1');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public function test_mobile_tablet_and_desktop_breakpoints_keep_navigation_accessible(): void
|
||||
{
|
||||
$admin = $this->platformAdminUser();
|
||||
|
||||
$this->browse(function (Browser $browser) use ($admin): void {
|
||||
$browser->loginAs($admin)
|
||||
->resize(390, 844)
|
||||
->visit('/admin')
|
||||
->waitFor('[data-dusk="page-ready"]')
|
||||
->assertSee('Platform')
|
||||
->assertScript('document.documentElement.scrollWidth <= document.documentElement.clientWidth + 1')
|
||||
->resize(768, 1024)
|
||||
->pause(250)
|
||||
->assertSee('Platform')
|
||||
->assertScript('document.documentElement.scrollWidth <= document.documentElement.clientWidth + 1')
|
||||
->resize(1440, 1000)
|
||||
->pause(250)
|
||||
->assertPresent('.wms-sidebar')
|
||||
->assertSee('Platform');
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user