Reorganize Woo Manager mobile header and store switcher placement.
Deploy Ladill Woo Manager / deploy (push) Successful in 1m7s
Deploy Ladill Woo Manager / deploy (push) Successful in 1m7s
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>
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user