feat: Send chat messages on Enter keypress and optimize media test environments
Some checks failed
linter / quality (push) Failing after 1m0s
tests / ci (8.3) (push) Failing after 49s
tests / ci (8.4) (push) Failing after 1m4s
tests / ci (8.5) (push) Failing after 1m5s

This commit is contained in:
Daan Meijer 2026-06-17 00:17:01 +02:00
parent 5b1a634d80
commit 8f9c4c9d1f
2 changed files with 6 additions and 5 deletions

View File

@ -192,7 +192,8 @@ function closeLightbox() {
id="content"
rows="3"
class="c-chat__textarea"
placeholder="Type a message..."
placeholder="Type a message... (Press Enter to send, Shift+Enter for newline)"
@keydown.enter.exact.prevent="submit"
></textarea>
<div v-if="form.errors.content" class="c-chat__error">
{{ form.errors.content }}

View File

@ -20,8 +20,8 @@ test('media can be attached to mutations, ledgers, and messages', function () {
$this->actingAs($user);
// 1. Test attaching media to a mutation
$file1 = UploadedFile::fake()->image('proof1.jpg');
$file2 = UploadedFile::fake()->image('proof2.png');
$file1 = UploadedFile::fake()->create('proof1.jpg', 100);
$file2 = UploadedFile::fake()->create('proof2.png', 100);
$response = $this->post(route('dynamics.ledgers.mutations.store', [$dynamic, $ledger]), [
'amount' => 50,
@ -42,7 +42,7 @@ test('media can be attached to mutations, ledgers, and messages', function () {
Storage::disk('public')->assertExists($mutation->media->last()->file_path);
// 2. Test attaching media to a ledger
$file3 = UploadedFile::fake()->image('rules.jpg');
$file3 = UploadedFile::fake()->create('rules.jpg', 100);
$response = $this->post(route('dynamics.ledgers.store', $dynamic), [
'name' => 'Worship Ledger',
'rules' => 'Specific rules',
@ -60,7 +60,7 @@ test('media can be attached to mutations, ledgers, and messages', function () {
// 3. Test attaching media to a chat message
$chat = $dynamic->chat;
$file4 = UploadedFile::fake()->image('chat_img.jpg');
$file4 = UploadedFile::fake()->create('chat_img.jpg', 100);
$response = $this->post(route('chats.messages.store', $chat), [
'content' => 'Check this out!',
'media' => [$file4],