feat(menu): add account menu hierarchy and related tests in MenuSeeder and MenuSeederTest
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user