From 648102cd824dae6317af757dcb66b9dae99b3cf4 Mon Sep 17 00:00:00 2001 From: Adam Weston Date: Sun, 1 Oct 2023 14:05:00 -0400 Subject: [PATCH] Fix: tests autoloader --- composer.json | 3 +-- tests/helpers.php | 13 ------------- tests/src/FormsTest.php | 16 +++++++--------- 3 files changed, 8 insertions(+), 24 deletions(-) delete mode 100644 tests/helpers.php diff --git a/composer.json b/composer.json index 811d92d..537911a 100644 --- a/composer.json +++ b/composer.json @@ -37,8 +37,7 @@ }, "autoload": { "files": [ - "src/helpers.php", - "tests/helpers.php" + "src/helpers.php" ], "psr-4": { "FilamentTiptapEditor\\": "src/", diff --git a/tests/helpers.php b/tests/helpers.php deleted file mode 100644 index 9692908..0000000 --- a/tests/helpers.php +++ /dev/null @@ -1,13 +0,0 @@ -assertFormFieldExists('html_content') ->assertFormFieldExists('json_content') ->assertFormFieldExists('text_content'); @@ -22,7 +20,7 @@ it('has proper html', function() { $page = Page::factory()->make(); - livewire(TestComponentWithForm::class) + Livewire::test(TestComponentWithForm::class) ->fillForm($page->toArray()) ->assertFormSet([ 'html_content' => $page->html_content, @@ -34,7 +32,7 @@ it('creates proper data', function() { $page = Page::factory()->make(); - livewire(CreatePage::class) + Livewire::test(CreatePage::class) ->fillForm([ 'title' => $page->title, 'html_content' => $page->html_content, @@ -54,7 +52,7 @@ $page = Page::factory()->create(); $newData = Page::factory()->make(); - livewire(EditPage::class, [ + Livewire::test(EditPage::class, [ 'record' => $page->getRouteKey(), ]) ->fillForm([ @@ -70,7 +68,7 @@ ->json_content->toBe($newData->json_content); }); -class TestComponentWithForm extends Livewire +class TestComponentWithForm extends LivewireFixture { public function form(Form $form): Form {