Skip to content

Commit 25a6722

Browse files
simonhampclaude
andcommitted
Remove 1000 character limit on support ticket environment field
Increase the environment field max validation from 1000 to 5000 characters to match the other bug report fields, and add a test. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a266952 commit 25a6722

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

app/Livewire/Customer/Support/Create.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ protected function validateStep2(): void
185185
$rules['tryingToDo'] = ['required', 'string', 'max:5000'];
186186
$rules['whatHappened'] = ['required', 'string', 'max:5000'];
187187
$rules['reproductionSteps'] = ['required', 'string', 'max:5000'];
188-
$rules['environment'] = ['required', 'string', 'max:1000'];
188+
$rules['environment'] = ['required', 'string', 'max:5000'];
189189

190190
$messages['tryingToDo.required'] = 'Please describe what you were trying to do.';
191191
$messages['whatHappened.required'] = 'Please describe what happened instead.';

tests/Feature/SupportTicketTest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,4 +1248,24 @@ public function ultra_users_can_access_ticket_index(): void
12481248
->assertOk()
12491249
->assertSeeLivewire(Index::class);
12501250
}
1251+
1252+
#[Test]
1253+
public function environment_field_accepts_more_than_1000_characters(): void
1254+
{
1255+
$user = $this->createUltraUser();
1256+
1257+
$longEnvironment = str_repeat('a', 2000);
1258+
1259+
Livewire::actingAs($user)
1260+
->test(Create::class)
1261+
->set('selectedProduct', 'desktop')
1262+
->call('nextStep')
1263+
->set('tryingToDo', 'Build an app')
1264+
->set('whatHappened', 'It crashed')
1265+
->set('reproductionSteps', '1. Open app')
1266+
->set('environment', $longEnvironment)
1267+
->call('nextStep')
1268+
->assertSet('currentStep', 3)
1269+
->assertHasNoErrors('environment');
1270+
}
12511271
}

0 commit comments

Comments
 (0)