File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515 </div >
1616
1717 @if ($this -> attachmentsAreEnabled () )
18- <div class =" comm:mb-2 comm:space-y-1" >
18+ <div class =" comm:mb-2 comm:space-y-1" x-show = " wasFocused " x-cloak >
1919 <label class =" comm:inline-flex comm:cursor-pointer comm:items-center comm:gap-1 comm:rounded-lg comm:border comm:border-gray-300 comm:dark:border-gray-700 comm:px-2 comm:py-1 comm:text-xs comm:text-gray-600 comm:dark:text-gray-300 comm:hover:bg-gray-100 comm:dark:hover:bg-gray-800" >
2020 <input type =" file" class =" comm:hidden" wire:model =" attachments" multiple />
2121 <x-filament::icon icon =" heroicon-s-paper-clip" class =" comm:h-4 comm:w-4" />
Original file line number Diff line number Diff line change 6060 ->assertSeeHtml ('wire:model="attachments" ' );
6161});
6262
63+ test ('the attach control is only shown once the editor is focused ' , function () {
64+ $ user = User::factory ()->create ();
65+ actingAs ($ user );
66+
67+ $ post = Post::factory ()->create ();
68+
69+ livewire (Comments::class, ['record ' => $ post , 'attachmentsEnabled ' => true ])
70+ ->assertSeeHtml ('x-show="wasFocused" ' );
71+ });
72+
6373test ('deleting a comment removes its attachments and files ' , function () {
6474 $ user = User::factory ()->create ();
6575 actingAs ($ user );
You can’t perform that action at this time.
0 commit comments