mirror of
https://github.com/tiennm99/coolify.git
synced 2026-08-24 10:26:42 +00:00
fix(ui): fix subscription access and mobile menu positioning
Add the subscription link for cloud team admins, anchor the mobile account menu below its trigger, and protect the subscription modal from Livewire morphing.
This commit is contained in:
@@ -62,6 +62,33 @@ test('unsubscribed cloud sidebar does not expose global search', function () {
|
||||
$response->assertDontSee('>Search</span>', false);
|
||||
});
|
||||
|
||||
test('subscribed cloud sidebar shows subscription link for team admins', function () {
|
||||
Subscription::create([
|
||||
'team_id' => $this->team->id,
|
||||
'stripe_subscription_id' => 'sub_active',
|
||||
'stripe_customer_id' => 'cus_active',
|
||||
'stripe_invoice_paid' => true,
|
||||
'stripe_plan_id' => 'price_active',
|
||||
'stripe_cancel_at_period_end' => false,
|
||||
'stripe_past_due' => false,
|
||||
]);
|
||||
|
||||
Once::flush();
|
||||
session(['currentTeam' => $this->team->fresh()]);
|
||||
|
||||
$html = view('components.navbar')->render();
|
||||
|
||||
expect($html)
|
||||
->toContain('title="Subscription"')
|
||||
->toContain(route('subscription.show'));
|
||||
});
|
||||
|
||||
test('subscription adjustment modal is protected from livewire morphing', function () {
|
||||
$view = file_get_contents(resource_path('views/livewire/subscription/actions.blade.php'));
|
||||
|
||||
expect($view)->toContain('<template x-teleport="body" wire:ignore>');
|
||||
});
|
||||
|
||||
test('subscription pricing page does not render a single-item pricing tab strip', function () {
|
||||
$html = view('components.dashboard.navbar', [
|
||||
'section' => 'subscription',
|
||||
|
||||
@@ -31,6 +31,18 @@ it('animates the dropdown panel when the user menu opens', function () {
|
||||
expect($stylesheet)->toContain('@import "tw-animate-css";');
|
||||
});
|
||||
|
||||
it('positions the account menu below the mobile trigger', function () {
|
||||
$menu = file_get_contents(resource_path('views/components/top-user-menu.blade.php'));
|
||||
$stylesheet = file_get_contents(resource_path('css/app.css'));
|
||||
|
||||
expect($menu)->toContain('top-user-menu-panel');
|
||||
expect($stylesheet)
|
||||
->toContain('.listbox-panel.top-user-menu-panel')
|
||||
->toContain('top: calc(100% + 0.25rem) !important;')
|
||||
->toContain('transform: none !important;')
|
||||
->toContain('max-height: calc(100dvh - 4.5rem) !important;');
|
||||
});
|
||||
|
||||
it('changes appearance from a submenu instead of navigating to a separate page', function () {
|
||||
$menu = file_get_contents(resource_path('views/components/top-user-menu.blade.php'));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user