Skip to content

Commit 68d11c1

Browse files
committed
test: assert job not run if game(s) already exist
1 parent 74a621e commit 68d11c1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/Feature/Forms/UpdatePlayerPanel/ValidPlayerUpdateTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@
88
use App\Http\Livewire\GameHistoryTable;
99
use App\Http\Livewire\OverviewPage;
1010
use App\Http\Livewire\UpdatePlayerPanel;
11+
use App\Jobs\PullMatchHistory;
1112
use App\Models\Game;
1213
use App\Models\GamePlayer;
1314
use App\Models\Player;
1415
use Illuminate\Foundation\Testing\WithFaker;
1516
use Illuminate\Support\Arr;
1617
use Illuminate\Support\Facades\Cache;
1718
use Illuminate\Support\Facades\Http;
19+
use Illuminate\Support\Facades\Queue;
1820
use Livewire\Livewire;
1921
use Symfony\Component\HttpFoundation\Response;
2022
use Tests\Mocks\Csrs\MockCsrAllService;
@@ -57,9 +59,10 @@ public function testAutomaticallyMarkedPrivateIfInvalidRecord(): void
5759
->assertViewHas('message', 'Profile updated!');
5860
}
5961

60-
public function testAutomaticallyDeferNextPagesIfGamesAlreayLoaded(): void
62+
public function testAutomaticallyDeferNextPagesIfGamesAlreadyLoaded(): void
6163
{
6264
// Arrange
65+
Queue::fake();
6366
$gamertag = $this->faker->word . $this->faker->numerify;
6467
$mockCsrResponse = (new MockCsrAllService())->success($gamertag);
6568
$mockMatchesResponse = (new MockMatchesService())->success($gamertag);
@@ -91,6 +94,8 @@ public function testAutomaticallyDeferNextPagesIfGamesAlreayLoaded(): void
9194
->assertViewHas('color', 'is-success')
9295
->assertViewHas('message', 'Profile updated!')
9396
->assertEmitted('$refresh');
97+
98+
Queue::assertNotPushed(PullMatchHistory::class);
9499
}
95100

96101
public function testInitialPageLoadDeferredFromApiCalls(): void

0 commit comments

Comments
 (0)