Files
ladill-woo-manager/tests/Feature/WooMobileNavTest.php
T
isaaccladandCursor 5a0022af72 Add Integrations hub for Woo marketing and shipping extensions.
Surface Google, Pinterest, Snapchat, and shipping status from the WordPress plugin with deep links to finish setup in WooCommerce.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-08 07:10:06 +00:00

59 lines
1.7 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_before_afia(): 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();
$switcherPos = strpos($html, 'Example Shop');
$afiaPos = strpos($html, 'afia');
$this->assertNotFalse($switcherPos);
$this->assertNotFalse($afiaPos);
$this->assertLessThan($afiaPos, $switcherPos);
}
}