From 3601ce8b6f6658a64cd545a6f89bb335ff2fafd7 Mon Sep 17 00:00:00 2001 From: Ben Date: Thu, 13 Aug 2026 18:26:33 +0200 Subject: [PATCH] Stop IndexTest from treating Flux CSS 80% as a transcription percent. assertDontSee('0%') matched unrelated classes like transparent_80% and the disk meter. --- tests/Feature/Recordings/IndexTest.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/Feature/Recordings/IndexTest.php b/tests/Feature/Recordings/IndexTest.php index f7421e3..fed23ae 100644 --- a/tests/Feature/Recordings/IndexTest.php +++ b/tests/Feature/Recordings/IndexTest.php @@ -6,6 +6,7 @@ use App\Jobs\TranscribeRecording; use App\Livewire\Recordings\Index; use App\Models\Recording; use App\Models\User; +use App\Services\DiskSpaceService; use Illuminate\Database\Eloquent\ModelNotFoundException; use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Support\Facades\Bus; @@ -17,6 +18,15 @@ class IndexTest extends TestCase { use RefreshDatabase; + protected function setUp(): void + { + parent::setUp(); + + $this->mock(DiskSpaceService::class, function ($mock): void { + $mock->shouldReceive('snapshot')->andReturn(null); + }); + } + public function test_index_page_renders_as_livewire(): void { $user = User::factory()->create(); @@ -153,7 +163,7 @@ class IndexTest extends TestCase Livewire::test(Index::class) ->assertSee('Just started') ->assertSee('Transcribing') - ->assertDontSee('0%'); + ->assertDontSeeHtml('tabular-nums text-xs text-zinc-500'); } public function test_queued_recordings_do_not_show_fake_percent(): void