Files
ladill-woo-manager/tests/Feature/WooMobileNavTest.php
T
isaaccladandCursor 93bfc3e2d2
Deploy Ladill Woo Manager / deploy (push) Successful in 1m7s
Reorganize Woo Manager mobile header and store switcher placement.
Desktop store switcher now sits after search; mobile shows route-based page titles, bottom nav, and store switching inside the profile sheet.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 02:45:14 +00:00

59 lines
1.8 KiB
PHP

<?php
namespace Tests\Feature;
use App\Models\User;
use App\Models\WooStore;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class WooMobileNavTest extends TestCase
{
use RefreshDatabase;
public function test_orders_page_shows_mobile_header_title_and_profile_store_menu(): void
{
$user = User::factory()->create();
WooStore::create([
'user_id' => $user->id,
'site_url' => 'https://shop.example.com',
'site_name' => 'Example Shop',
'status' => WooStore::STATUS_ACTIVE,
'connected_at' => now(),
]);
$this->actingAs($user)
->get(route('woo.orders.index'))
->assertOk()
->assertSee('min-w-0 flex-1 lg:hidden', false)
->assertSee('>Orders</h1>', false)
->assertSee('hidden text-xl font-semibold text-slate-900 lg:block', false)
->assertSee('Switch store', false)
->assertSee('>Profile</span>', false);
}
public function test_desktop_store_switcher_renders_after_search_form(): void
{
$user = User::factory()->create();
WooStore::create([
'user_id' => $user->id,
'site_url' => 'https://shop.example.com',
'site_name' => 'Example Shop',
'status' => WooStore::STATUS_ACTIVE,
'connected_at' => now(),
]);
$html = $this->actingAs($user)
->get(route('woo.dashboard'))
->assertOk()
->getContent();
$searchPos = strpos($html, 'Search orders…');
$switcherPos = strpos($html, 'Example Shop');
$this->assertNotFalse($searchPos);
$this->assertNotFalse($switcherPos);
$this->assertLessThan($switcherPos, $searchPos);
}
}