mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-app.git
synced 2026-05-05 04:54:53 +00:00
🔥 **Cleanup & Tests:** Removed the obsolete auth.register component and its related route, feature tests, and browser tests. Disabled public registration and added tests to ensure /register returns a 404. Added new tests for service, lecturer, city, venue, and meetup CRUD flows.
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
use App\Models\User;
|
||||
|
||||
it('lets an authenticated user update their profile name and persists it', function () {
|
||||
$user = actingAsUser(['name' => 'Old Name']);
|
||||
|
||||
$page = visit('/de/settings/profile');
|
||||
|
||||
$page->assertSee('Old Name')
|
||||
->fill('name', 'New Browser Name')
|
||||
->click('Save')
|
||||
->wait(1)
|
||||
->assertSee('Saved.')
|
||||
->assertNoJavaScriptErrors();
|
||||
|
||||
expect($user->refresh()->name)->toBe('New Browser Name');
|
||||
});
|
||||
|
||||
it('shows a validation error when the profile name is cleared', function () {
|
||||
actingAsUser(['name' => 'Original']);
|
||||
|
||||
$page = visit('/de/settings/profile');
|
||||
|
||||
$page->fill('name', '')
|
||||
->click('Save')
|
||||
->wait(1)
|
||||
->assertNoJavaScriptErrors();
|
||||
|
||||
expect(User::query()->where('name', '')->exists())->toBeFalse();
|
||||
});
|
||||
|
||||
it('still shows the updated name after a full page reload', function () {
|
||||
$user = actingAsUser(['name' => 'Before Reload']);
|
||||
|
||||
$page = visit('/de/settings/profile');
|
||||
$page->fill('name', 'After Reload')
|
||||
->click('Save')
|
||||
->wait(1);
|
||||
|
||||
$reloaded = visit('/de/settings/profile');
|
||||
$reloaded->assertSee('After Reload')
|
||||
->assertNoJavaScriptErrors();
|
||||
|
||||
expect($user->refresh()->name)->toBe('After Reload');
|
||||
});
|
||||
Reference in New Issue
Block a user