+
@if (isInstanceAdmin() && !isCloud())
diff --git a/tests/v4/Browser/UpgradeBadgeLayoutTest.php b/tests/v4/Browser/UpgradeBadgeLayoutTest.php
new file mode 100644
index 0000000000..361e4a097b
--- /dev/null
+++ b/tests/v4/Browser/UpgradeBadgeLayoutTest.php
@@ -0,0 +1,37 @@
+set('constants.coolify.version', $version);
+ seedBrowserResourceStack(['instanceSettings' => ['new_version_available' => true]]);
+ Cache::put('coolify:versions:all', ['coolify' => ['v4' => ['version' => '9.9.9']]], 3600);
+
+ $page = visit('/login')
+ ->fill('email', 'test@example.com')
+ ->fill('password', 'password')
+ ->click('Login')
+ ->assertSee('Dashboard')
+ ->assertVisible('header button[aria-label="Update available"]');
+
+ $layout = $page->script(<<<'JS'
+ () => {
+ const badge = document.querySelector('header button[aria-label="Update available"]');
+ const brand = badge.closest('header > div');
+
+ return {
+ badgeRight: badge.getBoundingClientRect().right,
+ brandRight: brand.getBoundingClientRect().right,
+ brandOverflows: brand.scrollWidth > brand.clientWidth,
+ };
+ }
+ JS);
+
+ $page->screenshot(filename: 'upgrade-badge-layout');
+
+ expect($layout['brandOverflows'])->toBeFalse()
+ ->and($layout['badgeRight'])->toBeLessThanOrEqual($layout['brandRight']);
+})->with(['4.3.19', '4.0.0-beta.470']);