This commit is contained in:
Pig Fang 2020-02-16 10:03:47 +08:00
parent d811f92dda
commit 5ac9b59116

View File

@ -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()