create(); Livewire::test(BlogEditor::class, ['post' => $post]) ->assertSee($post->title); } public function test_can_update_post_and_sync_tags() { $post = BlogPost::factory()->create(); $post->attachTag('Old Tag'); Livewire::test(BlogEditor::class, ['post' => $post]) ->set('post.title', 'Updated Title') ->set('tags', 'new tag 1, new tag 2') ->call('save'); $post->refresh(); $this->assertEquals('Updated Title', $post->title); $this->assertCount(2, $post->tags); $this->assertEquals(['new tag 1', 'new tag 2'], $post->tags->pluck('name')->toArray()); } }