formatting, juiste use voor UpdateDynamicRequest
linter / quality (push) Failing after 1m2s
tests / ci (8.3) (push) Failing after 48s
tests / ci (8.4) (push) Failing after 1m5s
tests / ci (8.5) (push) Failing after 1m5s

This commit is contained in:
Daan Meijer
2026-06-22 00:10:39 +02:00
parent 3e473de826
commit 10bd46a53e
56 changed files with 174 additions and 142 deletions
-1
View File
@@ -4,7 +4,6 @@ namespace Tests\Browser;
use App\Models\User;
use Laravel\Dusk\Browser;
use Tests\DuskTestCase;
test('user can register, log in, and log out', function () {
$this->browse(function (Browser $browser) {
+2 -3
View File
@@ -2,12 +2,11 @@
namespace Tests\Browser;
use App\Models\User;
use App\Models\Dynamic;
use App\Models\Ledger;
use App\Models\Mutation;
use App\Models\User;
use Laravel\Dusk\Browser;
use Tests\DuskTestCase;
test('access control and actions are enforced for owners and participants', function () {
// Create database state
@@ -46,7 +45,7 @@ test('access control and actions are enforced for owners and participants', func
]);
$this->browse(function (Browser $sessionOwner, Browser $sessionParticipant, Browser $sessionOutsider) use ($dynamic, $ledger, $owner, $participant, $outsider) {
// 1. Test Outsider trying to access dynamic they DO NOT belong to (should be forbidden / 403)
$sessionOutsider->loginAs($outsider)
->visit(route('dynamics.show', $dynamic))
+3 -5
View File
@@ -2,11 +2,9 @@
namespace Tests\Browser;
use App\Models\User;
use App\Models\Dynamic;
use App\Models\Ledger;
use App\Models\User;
use Laravel\Dusk\Browser;
use Tests\DuskTestCase;
test('multiple sessions can communicate in real time through websockets', function () {
// 1. Create realistic database state
@@ -15,7 +13,7 @@ test('multiple sessions can communicate in real time through websockets', functi
'email' => 'test-owner@example.com',
'password' => bcrypt('password'),
]);
$participant = User::factory()->create([
'name' => 'Submissive Bob',
'email' => 'test-sub@example.com',
@@ -32,7 +30,7 @@ test('multiple sessions can communicate in real time through websockets', functi
// 2. Spawn two separate browser sessions/browsers in parallel
$this->browse(function (Browser $sessionA, Browser $sessionB) use ($dynamic, $owner, $participant) {
// --- SESSION A: Owner ---
$sessionA->loginAs($owner)
->visit(route('dynamics.show', $dynamic))
+2 -2
View File
@@ -2,10 +2,10 @@
namespace Tests;
use Laravel\Dusk\TestCase as BaseTestCase;
use Facebook\WebDriver\Chrome\ChromeOptions;
use Facebook\WebDriver\Remote\RemoteWebDriver;
use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;
use Laravel\Dusk\TestCase as BaseTestCase;
abstract class DuskTestCase extends BaseTestCase
{
+2 -3
View File
@@ -1,10 +1,9 @@
<?php
use App\Models\User;
use App\Models\Dynamic;
use App\Models\Ledger;
use App\Models\Mutation;
use App\Models\Message;
use App\Models\User;
use App\Services\ActivityService;
use Illuminate\Support\Carbon;
@@ -80,7 +79,7 @@ test('dashboard groups and filters unread entities correctly based on cursor', f
'user_id' => $user->id,
'content' => 'Old message context',
]);
// Artificially advance cursor to after past message
Carbon::setTestNow(Carbon::now()->addMinutes(5));
$service = app(ActivityService::class);
+2 -2
View File
@@ -1,9 +1,9 @@
<?php
use App\Models\User;
use App\Mail\DynamicInvitationMail;
use App\Models\Dynamic;
use App\Models\DynamicInvitation;
use App\Mail\DynamicInvitationMail;
use App\Models\User;
use Illuminate\Support\Facades\Mail;
use Illuminate\Support\Facades\URL;
+1 -1
View File
@@ -1,8 +1,8 @@
<?php
use App\Models\User;
use App\Models\Dynamic;
use App\Models\Ledger;
use App\Models\User;
test('dynamic owners can view ledger creation form and create ledgers', function () {
$owner = User::factory()->create();
+3 -3
View File
@@ -1,11 +1,11 @@
<?php
use App\Models\User;
use App\Models\Dynamic;
use App\Models\Ledger;
use App\Models\Mutation;
use App\Models\Message;
use App\Models\Media;
use App\Models\Message;
use App\Models\Mutation;
use App\Models\User;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Facades\Storage;
+1 -1
View File
@@ -1,9 +1,9 @@
<?php
use App\Models\User;
use App\Models\Dynamic;
use App\Models\Ledger;
use App\Models\Mutation;
use App\Models\User;
test('owner can create a mutation which is automatically approved and does not say Approved', function () {
$owner = User::factory()->create();
+5 -5
View File
@@ -1,15 +1,15 @@
<?php
use App\Models\User;
use App\Models\Dynamic;
use App\Models\Ledger;
use App\Models\Mutation;
use App\Models\User;
test('authenticated participant can view another participant detail page in dynamic', function () {
$owner = User::factory()->create();
$participant = User::factory()->create();
$dynamic = Dynamic::factory()->create();
$dynamic->participants()->attach($owner->id, ['role' => 'owner', 'display_name' => 'The Boss']);
$dynamic->participants()->attach($participant->id, ['role' => 'participant']);
@@ -34,7 +34,7 @@ test('non-participant cannot view participant detail page in dynamic', function
$participant = User::factory()->create();
$outsider = User::factory()->create();
$dynamic = Dynamic::factory()->create();
$dynamic->participants()->attach($owner->id, ['role' => 'owner']);
$dynamic->participants()->attach($participant->id, ['role' => 'participant']);
@@ -50,7 +50,7 @@ test('participant detail page displays their recent mutations in dynamic', funct
$participant = User::factory()->create();
$dynamic = Dynamic::factory()->create();
$ledger = Ledger::factory()->create(['dynamic_id' => $dynamic->id]);
$dynamic->participants()->attach($owner->id, ['role' => 'owner']);
$dynamic->participants()->attach($participant->id, ['role' => 'participant', 'display_name' => 'Bitch']);
@@ -61,7 +61,7 @@ test('participant detail page displays their recent mutations in dynamic', funct
'amount' => 10,
'description' => 'Chore 1',
]);
$mutation2 = Mutation::factory()->create([
'ledger_id' => $ledger->id,
'user_id' => $participant->id,
+2 -2
View File
@@ -1,7 +1,7 @@
<?php
use App\Models\User;
use App\Models\Dynamic;
use App\Models\User;
test('user displayNameFor returns user name by default', function () {
$user = User::factory()->create(['name' => 'Alice']);
@@ -34,7 +34,7 @@ test('participant can update their display name', function () {
]);
$response->assertRedirect();
// Check database
$this->assertDatabaseHas('participants', [
'user_id' => $user->id,
+1 -2
View File
@@ -1,9 +1,8 @@
<?php
use App\Models\User;
use App\Models\Dynamic;
use App\Models\Ledger;
use App\Models\PredefinedMutation;
use App\Models\User;
test('owner can view predefined mutations for dynamic', function () {
$owner = User::factory()->create();