fix: viewport-fixed, deterministic background so content changes don't shift it

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BCrwHHnGCB5XH968Nxokqw
This commit is contained in:
2026-09-04 15:56:22 -03:00
parent 80235dca3a
commit b0b760e4aa
3 changed files with 32 additions and 10 deletions

View File

@@ -96,6 +96,20 @@ class InboxPageTest extends TestCase
$this->assertStringNotContainsString('class="counter"', $html);
}
public function test_background_is_viewport_fixed_and_deterministic(): void
{
// Фон не должен пересчитываться при росте документа (раскрытие панелей)
// и перемешиваться при перезагрузке после действий.
$html = $this->get('/', ['X-Remote-User' => 'nikita'])->assertOk()->getContent();
foreach (['.layer{position:fixed', '.nebula{position:fixed', '.core{position:fixed', '.dust{position:fixed', '.band{position:fixed'] as $rule) {
$this->assertStringContainsString($rule, $html);
}
$js = file_get_contents(public_path('inbox.js'));
$this->assertStringNotContainsString('Math.random', $js);
$this->assertStringContainsString('const rand = ', $js);
}
public function test_hidden_attribute_beats_flex_display_rules(): void
{
// .panel .body{display:flex} иначе перебивает браузерное [hidden]{display:none},