|
8 | 8 | use App\Http\Livewire\GameHistoryTable;
|
9 | 9 | use App\Http\Livewire\OverviewPage;
|
10 | 10 | use App\Http\Livewire\UpdatePlayerPanel;
|
| 11 | +use App\Jobs\PullMatchHistory; |
11 | 12 | use App\Models\Game;
|
12 | 13 | use App\Models\GamePlayer;
|
13 | 14 | use App\Models\Player;
|
14 | 15 | use Illuminate\Foundation\Testing\WithFaker;
|
15 | 16 | use Illuminate\Support\Arr;
|
16 | 17 | use Illuminate\Support\Facades\Cache;
|
17 | 18 | use Illuminate\Support\Facades\Http;
|
| 19 | +use Illuminate\Support\Facades\Queue; |
18 | 20 | use Livewire\Livewire;
|
19 | 21 | use Symfony\Component\HttpFoundation\Response;
|
20 | 22 | use Tests\Mocks\Csrs\MockCsrAllService;
|
@@ -57,9 +59,10 @@ public function testAutomaticallyMarkedPrivateIfInvalidRecord(): void
|
57 | 59 | ->assertViewHas('message', 'Profile updated!');
|
58 | 60 | }
|
59 | 61 |
|
60 |
| - public function testAutomaticallyDeferNextPagesIfGamesAlreayLoaded(): void |
| 62 | + public function testAutomaticallyDeferNextPagesIfGamesAlreadyLoaded(): void |
61 | 63 | {
|
62 | 64 | // Arrange
|
| 65 | + Queue::fake(); |
63 | 66 | $gamertag = $this->faker->word . $this->faker->numerify;
|
64 | 67 | $mockCsrResponse = (new MockCsrAllService())->success($gamertag);
|
65 | 68 | $mockMatchesResponse = (new MockMatchesService())->success($gamertag);
|
@@ -91,6 +94,8 @@ public function testAutomaticallyDeferNextPagesIfGamesAlreayLoaded(): void
|
91 | 94 | ->assertViewHas('color', 'is-success')
|
92 | 95 | ->assertViewHas('message', 'Profile updated!')
|
93 | 96 | ->assertEmitted('$refresh');
|
| 97 | + |
| 98 | + Queue::assertNotPushed(PullMatchHistory::class); |
94 | 99 | }
|
95 | 100 |
|
96 | 101 | public function testInitialPageLoadDeferredFromApiCalls(): void
|
|
0 commit comments