Skip to content

Commit 3b6cb6c

Browse files
committed
Make alias assertions respect component prefix
1 parent b7509e6 commit 3b6cb6c

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

tests/Livewire/CommentTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
use Kirschbaum\Commentions\Comment;
44
use Kirschbaum\Commentions\Comment as CommentModel;
5+
use Kirschbaum\Commentions\Config;
56
use Kirschbaum\Commentions\Livewire\Comment as CommentComponent;
67
use Kirschbaum\Commentions\RenderableComment;
78
use Tests\Models\Post;
@@ -232,11 +233,13 @@
232233
$post = Post::factory()->create();
233234
$comment = CommentModel::factory()->author($user)->commentable($post)->create();
234235

236+
$componentAlias = Config::getComponentPrefix().'comment';
237+
235238
livewire(CommentComponent::class, [
236239
'comment' => $comment,
237240
])
238241
->call('edit')
239-
->assertSee('commentions.comment', false);
242+
->assertSee($componentAlias, false);
240243
});
241244

242245
test('can render a custom renderable comment', function () {

tests/Livewire/CommentsTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22

33
use Illuminate\Support\Facades\Event;
4+
use Kirschbaum\Commentions\Config;
45
use Kirschbaum\Commentions\Events\CommentWasCreatedEvent;
56
use Kirschbaum\Commentions\Livewire\Comments;
67
use Tests\Models\Post;
@@ -91,7 +92,9 @@
9192

9293
$post = Post::factory()->create();
9394

95+
$componentAlias = Config::getComponentPrefix().'comments';
96+
9497
livewire(Comments::class, [
9598
'record' => $post,
96-
])->assertSee('commentions.comments', false);
99+
])->assertSee($componentAlias, false);
97100
});

0 commit comments

Comments
 (0)