Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ parameters:
path: src/RenderableComment.php

-
message: '#^Call to an undefined method PHPUnit\\Framework\\TestCase::[a-zA-Z0-9_]+\(\)\.$#'
message: '#^Call to an undefined method Pest\\PendingCalls\\TestCall::[a-zA-Z0-9_]+\(\)\.$#'
identifier: method.notFound
count: 3
path: tests/**/*.php
Expand All @@ -58,13 +58,13 @@ parameters:
path: tests/Pest.php

-
message: '#^Call to an undefined method PHPUnit\\Framework\\TestCase\:\:assertDatabaseHas\(\)\.$#'
message: '#^Call to an undefined method Pest\\PendingCalls\\TestCall\:\:assertDatabaseHas\(\)\.$#'
identifier: method.notFound
count: 2
path: tests/Livewire/CommentReactionTest.php

-
message: '#^Call to an undefined method PHPUnit\\Framework\\TestCase\:\:assertDatabaseMissing\(\)\.$#'
message: '#^Call to an undefined method Pest\\PendingCalls\\TestCall\:\:assertDatabaseMissing\(\)\.$#'
identifier: method.notFound
count: 3
path: tests/Livewire/CommentReactionTest.php
1 change: 1 addition & 0 deletions resources/lang/ar/comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
return [
'label' => 'التعليقات',
'placeholder' => 'اكتب تعليقك…',
'add_comment' => 'أضف تعليقًا',
'no_comments_yet' => 'لا توجد تعليقات .',

'user_avatar_alt' => 'صورة المستخدم ',
Expand Down
1 change: 1 addition & 0 deletions resources/lang/en/comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
return [
'label' => 'Comments',
'placeholder' => 'Type your comment…',
'add_comment' => 'Add a comment',
'no_comments_yet' => 'No comments yet.',

'user_avatar_alt' => 'User Avatar',
Expand Down
1 change: 1 addition & 0 deletions resources/lang/es/comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
return [
'label' => 'Comentarios',
'placeholder' => 'Escribe tu comentario...',
'add_comment' => 'Añadir un comentario',
'no_comments_yet' => 'Aún no hay comentarios.',

'user_avatar_alt' => 'Avatar de usuario',
Expand Down
1 change: 1 addition & 0 deletions resources/lang/fr/comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
return [
'label' => 'Commentaires',
'placeholder' => 'Rédiger votre commentaire...',
'add_comment' => 'Ajouter un commentaire',
'no_comments_yet' => 'Aucun commentaire pour le moment.',

'user_avatar_alt' => 'Avatar de l\'utilisateur',
Expand Down
1 change: 1 addition & 0 deletions resources/lang/nl/comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

return [
'label' => 'Opmerkingen',
'add_comment' => 'Een opmerking toevoegen',
'no_comments_yet' => 'Nog geen opmerkingen.',

'user_avatar_alt' => 'Profielfoto',
Expand Down
1 change: 1 addition & 0 deletions resources/lang/ro/comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
return [
'label' => 'Comentarii',
'placeholder' => 'Scrie comentariul tău...',
'add_comment' => 'Adaugă un comentariu',
'no_comments_yet' => 'Niciun comentariu încă.',

'user_avatar_alt' => 'Avatar',
Expand Down
4 changes: 2 additions & 2 deletions resources/views/comments.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{{-- Main Comments Area --}}
<div class="comm:flex-1 comm:space-y-2">
@if (Config::resolveAuthenticatedUser()?->can('create', Config::getCommentModel()))
<form wire:submit.prevent="save" x-cloak>
<div x-cloak role="form" aria-label="{{ __('commentions::comments.add_comment') }}">
{{-- tiptap editor --}}
<div class="comm:relative tip-tap-container comm:mb-2" x-on:click="wasFocused = true" wire:ignore>
<div
Expand All @@ -29,7 +29,7 @@
>{{ __('commentions::comments.cancel') }}</x-filament::button>
</div>
</template>
</form>
</div>
@endif

<livewire:dynamic-component
Expand Down
15 changes: 15 additions & 0 deletions tests/Livewire/CommentsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,21 @@
Event::assertNotDispatched(CommentWasCreatedEvent::class);
});

test('comments composer does not render a form element', function () {
/** @var User $user */
$user = User::factory()->create();
actingAs($user);

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

livewire(Comments::class, [
'record' => $post,
])
->assertDontSeeHtml('<form')
->assertSeeHtml('role="form"')
->assertSeeHtml('wire:click="save"');
});

test('comments editor includes prefixed component alias', function () {
/** @var User $user */
$user = User::factory()->create();
Expand Down
Loading