diff --git a/tests/ServicesTest/HookTest.php b/tests/ServicesTest/HookTest.php index 95856bd8..664bd367 100644 --- a/tests/ServicesTest/HookTest.php +++ b/tests/ServicesTest/HookTest.php @@ -4,7 +4,6 @@ namespace Tests; use App\Models\User; use App\Services\Hook; -use Symfony\Component\DomCrawler\Crawler; class HookTest extends TestCase { @@ -90,12 +89,8 @@ class HookTest extends TestCase { $user = factory(User::class)->create(); Hook::sendNotification([$user], 'Ibara Mayaka'); - $html = $this->actingAs($user) - ->get('/user') - ->assertSee('Ibara Mayaka') - ->getContent(); - $crawler = new Crawler($html); - $this->assertEquals('1', trim($crawler->filter('.badge-warning')->text())); + $user->refresh(); + $this->assertCount(1, $user->unreadNotifications); } public function testPushMiddleware()