Skip to content

Commit

Permalink
assert equals instead of containing in html
Browse files Browse the repository at this point in the history
  • Loading branch information
2amjsouza committed Dec 8, 2023
1 parent fdf264b commit 0d42b90
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/laravel-functional/BladeComponentCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0d42b90

Please sign in to comment.