🔥 **Cleanup:** Removed BookCase and OrangePill models, factories, migrations, and related references. Added tests for new service and meetup creation flows. Updated PHPUnit settings and browser-specific configurations.

This commit is contained in:
BT
2026-05-02 22:00:26 +01:00
parent 63aed880e1
commit 04e3e30fcf
54 changed files with 3440 additions and 298 deletions
+49
View File
@@ -0,0 +1,49 @@
<?php
use App\Models\City;
use App\Models\Country;
use App\Models\Meetup;
use Livewire\Livewire;
beforeEach(function () {
$country = Country::factory()->create(['code' => 'de']);
$this->city = City::factory()->create(['country_id' => $country->id]);
$this->meetup = Meetup::factory()->create(['city_id' => $this->city->id, 'name' => 'Original Name']);
});
it('updates an existing Meetup name when authenticated', function () {
actingAsUser();
Livewire::test('meetups.edit', ['meetup' => $this->meetup])
->set('name', 'Updated Name')
->set('city_id', $this->city->id)
->set('community', 'einundzwanzig')
->call('updateMeetup')
->assertHasNoErrors();
expect($this->meetup->refresh()->name)->toBe('Updated Name');
});
it('rejects update when name collides with another existing Meetup', function () {
Meetup::factory()->create(['name' => 'Other Name', 'city_id' => $this->city->id]);
actingAsUser();
Livewire::test('meetups.edit', ['meetup' => $this->meetup])
->set('name', 'Other Name')
->call('updateMeetup')
->assertHasErrors(['name' => 'unique']);
});
it('allows update when name is unchanged (Rule::unique ignores own id)', function () {
actingAsUser();
Livewire::test('meetups.edit', ['meetup' => $this->meetup])
->set('name', 'Original Name')
->set('community', 'einundzwanzig')
->call('updateMeetup')
->assertHasNoErrors();
});
it('redirects guests when accessing meetup-edit', function () {
$this->get('/de/meetup-edit/'.$this->meetup->id)->assertRedirect(route('login'));
});