feat(menu): add account menu hierarchy and related tests in MenuSeeder and MenuSeederTest

This commit is contained in:
2026-07-24 10:07:47 -03:00
parent f6ce85cbde
commit 7889d747d9
3 changed files with 137 additions and 3 deletions

View File

@@ -14,6 +14,35 @@ class MenuSeederTest extends TestCase
{
use RefreshDatabase;
public function test_it_seeds_the_account_menu_hierarchy(): void
{
$tenant = $this->createTenant('account_tenant');
$this->seed(MenuSeeder::class);
$account = Menu::query()
->with('children')
->where('code', 'account')
->firstOrFail();
$this->assertSame(Menu::CONTENT_TYPE_DYNAMIC, $account->content_type);
$this->assertSame('/mi-cuenta', $account->route);
$this->assertSame([
'profile',
'purchases',
'tickets',
], $account->children->pluck('code')->sort()->values()->all());
$this->assertSame([
'profile' => '/mi-cuenta/datos-personales',
'purchases' => '/mi-cuenta/compras',
'tickets' => '/mi-cuenta/tickets',
], $account->children->pluck('route', 'code')->sortKeys()->all());
$this->assertTrue(
$tenant->menues()->where('menues.code', 'account')->exists()
);
}
public function test_it_seeds_the_help_menu_hierarchy_and_content_schemas(): void
{
$this->seed(MenuSeeder::class);