Skip to content

Commit db2b71c

Browse files
fix:[lar-18] create thread test with locale and set local app
1 parent b763941 commit db2b71c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/Feature/Livewire/Pages/Forum/IndexTest.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use App\Livewire\Pages\Forum\Index;
66
use App\Models\Thread;
77
use Livewire\Livewire;
8+
use Illuminate\Support\Facades\App;
89

910
use function Pest\Laravel\get;
1011

@@ -18,7 +19,8 @@
1819
it('forum page renders views with threads', function (): void {
1920
get(route('forum.index'))->assertOk();
2021

21-
Thread::factory()->count(50)->create();
22+
Thread::factory()->count(50)->create(['locale' => 'fr']);
23+
App::setLocale('fr');
2224

2325
Livewire::test(Index::class)
2426
->assertViewHas('threads', fn ($threads) => count($threads) === 30)

0 commit comments

Comments
 (0)