22-05-2026 Optimierung der User und Admin Panels
This commit is contained in:
parent
d2ba22c0cf
commit
e8c47b7553
73 changed files with 10282 additions and 1546 deletions
|
|
@ -97,7 +97,7 @@ test('save with all required fields persists the press release and syncs contact
|
|||
expect($pr->contacts->first()->id)->toBe($contact->id);
|
||||
});
|
||||
|
||||
test('save without a contact id fails validation', function () {
|
||||
test('save without a contact id succeeds and leaves contacts empty', function () {
|
||||
/** @var TestCase $this */
|
||||
$customer = User::factory()->create(['is_active' => true]);
|
||||
$customer->assignRole('customer');
|
||||
|
|
@ -113,7 +113,28 @@ test('save without a contact id fails validation', function () {
|
|||
->set('text', str_repeat('x', 60))
|
||||
->set('categoryId', $category->id)
|
||||
->call('save', 'draft')
|
||||
->assertHasErrors(['contactId']);
|
||||
->assertHasNoErrors(['contactId']);
|
||||
|
||||
$pr = PressRelease::query()->where('title', 'Titel mit genug Zeichen')->firstOrFail();
|
||||
expect($pr->contacts()->count())->toBe(0);
|
||||
});
|
||||
|
||||
test('presubmit check for missing contact is warning, not error', function () {
|
||||
/** @var TestCase $this */
|
||||
$customer = User::factory()->create(['is_active' => true]);
|
||||
$customer->assignRole('customer');
|
||||
$company = Company::factory()->presseecho()->create();
|
||||
$customer->companies()->attach($company->id, ['role' => 'owner']);
|
||||
|
||||
$this->actingAs($customer);
|
||||
|
||||
$component = LivewireVolt::test('customer.press-releases.create')
|
||||
->set('contactId', null);
|
||||
|
||||
$checks = collect($component->instance()->presubmitChecks);
|
||||
$contactCheck = $checks->firstWhere('key', 'contact');
|
||||
|
||||
expect($contactCheck['status'])->toBe('warn');
|
||||
});
|
||||
|
||||
test('boilerplate override is null when toggle is off even if text is filled', function () {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue