Skip to content

Commit

Permalink
Fix switch-toggle test
Browse files Browse the repository at this point in the history
  • Loading branch information
rawilk committed Oct 20, 2022
1 parent 1bfb74e commit 34b3d4e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 43 deletions.
24 changes: 18 additions & 6 deletions tests/Components/Choice/SwitchToggleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,9 @@
namespace Rawilk\FormComponents\Tests\Components\Choice;

use Rawilk\FormComponents\Tests\Components\ComponentTestCase;
use Spatie\Snapshots\MatchesSnapshots;

final class SwitchToggleTest extends ComponentTestCase
{
use MatchesSnapshots;

/** @test */
public function can_be_rendered(): void
{
Expand All @@ -32,9 +29,24 @@ public function accepts_a_container_class(): void
/** @test */
public function custom_attributes_are_applied_to_the_button(): void
{
$this->assertMatchesSnapshot(
(string) $this->blade('<x-switch-toggle id="foo" class="foo-class" data-foo="bar" />')
);
$this->blade('<x-switch-toggle id="foo" class="foo-class" data-foo="bar" />')
->assertSeeInOrder([
'<button',
'id="foo"',
'>',
], false)
->assertSeeInOrder([
'<button',
'class="',
'foo-class',
'"',
'>',
], false)
->assertSeeInOrder([
'<button',
'data-foo="bar"',
'>',
], false);
}

/** @test */
Expand Down

This file was deleted.

0 comments on commit 34b3d4e

Please sign in to comment.