From 0d42b909912430efab2feed25d41a137c9069e70 Mon Sep 17 00:00:00 2001 From: Jonatas Souza Date: Fri, 8 Dec 2023 10:12:21 -0300 Subject: [PATCH] assert equals instead of containing in html --- tests/laravel-functional/BladeComponentCest.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/laravel-functional/BladeComponentCest.php b/tests/laravel-functional/BladeComponentCest.php index 75c00f1..3673b87 100644 --- a/tests/laravel-functional/BladeComponentCest.php +++ b/tests/laravel-functional/BladeComponentCest.php @@ -70,10 +70,19 @@ public function testQrCodeComponentSimpleText(FunctionalTester $I) { $I->wantTo('Blade Component: Assert simple text QR Code creation'); $I->amOnRoute('app.blade'); + $source = $I->grabPageSource(); $qrCode = file_get_contents(codecept_data_dir('blade/qrcode-blade.png')); - $I->seeInSource(base64_encode($qrCode)); + $I->assertEquals(base64_encode($qrCode), $this->grabBase64($source)); + } + + protected function grabBase64(string $source) + { + $data = explode('base64,', $source)[1]; + $data = explode('=="', $data)[0]; + + return $data . '=='; } public function testQrCodeComponentWithImage(FunctionalTester $I)