Skip to content

Commit

Permalink
Add test to ensure icon component does not end in newline
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusmoore committed Oct 22, 2024
1 parent 46ad1d0 commit 3f79fd7
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/Unit/BladeComponents/IconComponentTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace Tests\Unit\BladeComponents;

use Illuminate\Support\Facades\View;
use Illuminate\Support\Str;
use Tests\TestCase;

class IconComponentTest extends TestCase
{
public function testIconComponentDoesNotEndInNewline()
{
$renderedTemplateString = View::make('blade.icon', ['type' => 'checkout'])->render();

$this->assertFalse(
Str::endsWith($renderedTemplateString, PHP_EOL),
'Newline found at end of icon component. Bootstrap tables will not render if there is a newline at the end of the file.'
);
}
}

0 comments on commit 3f79fd7

Please sign in to comment.