fix: team permissions, transactions, form sentinels and review polish

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Doar Mihai
2026-10-17 16:12:31 +03:00
co-authored by Claude Sonnet 5.5
parent c4e6173e46
commit 231123f641
8 changed files with 343 additions and 57 deletions
+2
View File
@@ -63,12 +63,14 @@ test('update replaces members and uses the product owner for the owner rule', fu
$this->actingAs($admin)->put(route('products.update', $product), teamPayload([
'category_id' => $product->category_id,
'members_present' => 1,
'members' => [['user_id' => $owner->id, 'role' => 'Founder']],
]))->assertSessionHasErrors('members.0.user_id');
expect($product->members()->pluck('users.id')->all())->toBe([$a->id]);
$this->actingAs($admin)->put(route('products.update', $product), teamPayload([
'category_id' => $product->category_id,
'members_present' => 1,
'members' => [['user_id' => $admin->id, 'role' => 'Helper'], ['user_id' => $b->id, 'role' => 'New']],
]))->assertRedirect()->assertSessionHasNoErrors();
expect($product->members()->pluck('users.id')->all())->toEqualCanonicalizing([$admin->id, $b->id]);