feat: Send chat messages on Enter keypress and optimize media test environments
This commit is contained in:
parent
5b1a634d80
commit
8f9c4c9d1f
@ -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 }}
|
||||
|
||||
@ -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],
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user