We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b5f2f24 commit ba78b75Copy full SHA for ba78b75
stubs/invitation-only-super-admin/tests/Feature/CreateTeamTest.php
@@ -0,0 +1,17 @@
1
+<?php
2
+
3
+use App\Models\User;
4
+use App\UserType;
5
+use Laravel\Jetstream\Http\Livewire\CreateTeamForm;
6
+use Livewire\Livewire;
7
8
+test('teams can be created', function () {
9
+ $this->actingAs($user = User::factory()->withPersonalTeam()->create(['type' => UserType::SuperAdmin]));
10
11
+ Livewire::test(CreateTeamForm::class)
12
+ ->set(['state' => ['name' => 'Test Team']])
13
+ ->call('createTeam');
14
15
+ expect($user->fresh()->ownedTeams)->toHaveCount(2);
16
+ expect($user->fresh()->ownedTeams()->latest('id')->first()->name)->toEqual('Test Team');
17
+});
0 commit comments