fix: resolve 15 pre-existing test failures flagged across 3 retrospectives

Delete 14 legacy Folder test files (FolderTypeTest, MediaDownloadTest,
FolderMentionTest) that referenced removed routes/tables from the Epic 0
folders-to-declarations rename. Declaration equivalents already exist.
Fix WorkerDashboardTest session edge case where HandleInertiaRequests
middleware auto-assigns workspace, invalidating the no-session assumption.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-24 10:50:46 +01:00
parent 4dca01a082
commit 716e9fc4f6
4 changed files with 4 additions and 340 deletions

View File

@@ -267,13 +267,11 @@ test('owner and manager dashboard returns isWorker false', function () {
);
});
test('worker without workspace session gets isWorker false in fallback', function () {
$worker = User::factory()->create();
$workspace = Workspace::factory()->create();
$workspace->users()->attach($worker->id, ['role' => 'worker']);
test('user without any workspace gets isWorker false in fallback', function () {
$user = User::factory()->create();
// No session(['current_workspace_id' => ...]) — simulate no active workspace
$this->actingAs($worker);
// User has no workspace attachments — middleware cannot auto-assign
$this->actingAs($user);
$response = $this->get(route('dashboard'));
$response->assertOk();