1
0
Files
breadcrumb-the-shire/tests/Architecture/FilterDrawerRuntimeContractTest.php
fs 12bc58dffa chore: remove legacy tools/codex-skills (moved to .agents/skills), split filter drawer tests, clean up stale docs
- tools/codex-skills/ removed — skills now live in .agents/skills/
- docs/reference-agents-*.md removed — replaced by .agents/workflow.md
- FilterDrawerContractTest split into Runtime + Template contract tests
- bin scripts and .gitignore updated for .agents/ paths

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 19:59:08 +01:00

38 lines
1.8 KiB
PHP

<?php
namespace MintyPHP\Tests\Architecture;
use PHPUnit\Framework\TestCase;
class FilterDrawerRuntimeContractTest extends TestCase
{
use ProjectFileAssertionSupport;
public function testUsersResetKeepsTenantParam(): void
{
$moduleContent = $this->readProjectFile('web/js/pages/admin-users-index.js');
$this->assertStringContainsString("preserveFilterParams: ['tenant']", $moduleContent);
}
public function testFilterDrawerAndExperienceImplementFocusTrapAndDirtyApplyUi(): void
{
$drawerJs = $this->readProjectFile('web/js/components/app-filter-drawer.js');
$this->assertStringContainsString("drawer.setAttribute('role', 'dialog')", $drawerJs);
$this->assertStringContainsString("drawer.setAttribute('aria-modal', 'true')", $drawerJs);
$this->assertStringContainsString("if (event.key !== 'Tab') {return;}", $drawerJs);
$this->assertStringContainsString('if (lastTrigger && typeof lastTrigger.focus === \'function\'', $drawerJs);
$experienceJs = $this->readProjectFile('web/js/pages/app-list-filter-experience.js');
$this->assertStringContainsString('countDraftChanges(', $experienceJs);
$this->assertStringContainsString('countActiveDraftFilters(', $experienceJs);
$this->assertStringContainsString('drawerController.setApplyEnabled(changedCount > 0);', $experienceJs);
$this->assertStringContainsString('drawerController.setApplyCount(activeCount);', $experienceJs);
$this->assertStringContainsString('announceLive(', $experienceJs);
$stateJs = $this->readProjectFile('web/js/pages/app-list-filter-state.js');
$this->assertStringContainsString('buildChipsFromMeta', $stateJs);
$this->assertStringContainsString('removeChipFromMetaState', $stateJs);
$this->assertStringContainsString('clearMetaState', $stateJs);
}
}