Skip to content

Commit

Permalink
fix bug where the path class attribute was not output correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
johanrosenson committed Jul 12, 2021
1 parent 4c956f0 commit d6500bb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion resources/views/components/fa-icon.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
<defs><style>{{ $style }}</style></defs>
@endif
@foreach ($paths as $path)
<path fill="currentColor" {{ $path['class'] ? 'class="' . $path['class'] . '"' : '' }} d="{{ $path['d'] }}" />
<path fill="currentColor" class="{{ $path['class'] }}" d="{{ $path['d'] }}" />
@endforeach
</svg>
13 changes: 13 additions & 0 deletions tests/ComponentsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,19 @@ public function duotone_360_degrees_can_be_rendered() : void
$this->assertIsString($this->renderComponent($component));
}

/** @test */
public function duotone_user_crown_have_the_correct_classnames() : void
{
$component = $this->app->make(FaDuotone::class, [
'name' => 'user-crown',
]);

$output = $this->renderComponent($component);

$this->assertStringContainsString('class="fa-primary"', $output);
$this->assertStringContainsString('class="fa-secondary"', $output);
}

/**
* @test
* @dataProvider components
Expand Down

0 comments on commit d6500bb

Please sign in to comment.