create(); $artwork = Artwork::factory()->for($author)->create(); ArtworkComment::factory()->for($artwork)->for($author)->create([ 'content' => 'Latest comments page regression comment', 'raw_content' => 'Latest comments page regression comment', 'rendered_content' => '

Latest comments page regression comment

', 'created_at' => now()->subMinutes(5), ]); $this->get(route('legacy.latest_comments')) ->assertOk() ->assertSee('Latest Comments'); }); it('returns latest comments api data', function (): void { $author = User::factory()->create(); $artwork = Artwork::factory()->for($author)->create([ 'title' => 'Latest Comments Artwork', 'slug' => 'latest-comments-artwork', ]); $comment = ArtworkComment::factory()->for($artwork)->for($author)->create([ 'content' => 'Latest comments api regression comment', 'raw_content' => 'Latest comments api regression comment', 'rendered_content' => '

Latest comments api regression comment

', 'created_at' => now()->subMinutes(10), ]); $this->getJson(route('api.comments.latest')) ->assertOk() ->assertJsonPath('data.0.comment_id', $comment->id) ->assertJsonPath('data.0.commenter.id', $author->id) ->assertJsonPath('data.0.artwork.id', $artwork->id) ->assertJsonPath('meta.total', 1); });