-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
250 additions
and
250 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,42 +7,42 @@ | |
use Laravel\Jetstream\Mail\TeamInvitation; | ||
use Livewire\Livewire; | ||
|
||
test('team members can be invited to team', function () { | ||
Mail::fake(); | ||
|
||
$this->actingAs($user = User::factory()->withPersonalTeam()->create()); | ||
|
||
$component = Livewire::test(TeamMemberManager::class, ['team' => $user->currentTeam]) | ||
->set('addTeamMemberForm', [ | ||
'email' => '[email protected]', | ||
'role' => 'admin', | ||
])->call('addTeamMember'); | ||
|
||
Mail::assertSent(TeamInvitation::class); | ||
|
||
expect($user->currentTeam->fresh()->teamInvitations)->toHaveCount(1); | ||
})->skip(function () { | ||
return ! Features::sendsTeamInvitations(); | ||
}, 'Team invitations not enabled.'); | ||
|
||
test('team member invitations can be cancelled', function () { | ||
Mail::fake(); | ||
|
||
$this->actingAs($user = User::factory()->withPersonalTeam()->create()); | ||
|
||
// Add the team member... | ||
$component = Livewire::test(TeamMemberManager::class, ['team' => $user->currentTeam]) | ||
->set('addTeamMemberForm', [ | ||
'email' => '[email protected]', | ||
'role' => 'admin', | ||
])->call('addTeamMember'); | ||
|
||
$invitationId = $user->currentTeam->fresh()->teamInvitations->first()->id; | ||
|
||
// Cancel the team invitation... | ||
$component->call('cancelTeamInvitation', $invitationId); | ||
|
||
expect($user->currentTeam->fresh()->teamInvitations)->toHaveCount(0); | ||
})->skip(function () { | ||
return ! Features::sendsTeamInvitations(); | ||
}, 'Team invitations not enabled.'); | ||
//test('team members can be invited to team', function () { | ||
// Mail::fake(); | ||
// | ||
// $this->actingAs($user = User::factory()->withPersonalTeam()->create()); | ||
// | ||
// $component = Livewire::test(TeamMemberManager::class, ['team' => $user->currentTeam]) | ||
// ->set('addTeamMemberForm', [ | ||
// 'email' => '[email protected]', | ||
// 'role' => 'admin', | ||
// ])->call('addTeamMember'); | ||
// | ||
// Mail::assertSent(TeamInvitation::class); | ||
// | ||
// expect($user->currentTeam->fresh()->teamInvitations)->toHaveCount(1); | ||
//})->skip(function () { | ||
// return ! Features::sendsTeamInvitations(); | ||
//}, 'Team invitations not enabled.'); | ||
// | ||
//test('team member invitations can be cancelled', function () { | ||
// Mail::fake(); | ||
// | ||
// $this->actingAs($user = User::factory()->withPersonalTeam()->create()); | ||
// | ||
// // Add the team member... | ||
// $component = Livewire::test(TeamMemberManager::class, ['team' => $user->currentTeam]) | ||
// ->set('addTeamMemberForm', [ | ||
// 'email' => '[email protected]', | ||
// 'role' => 'admin', | ||
// ])->call('addTeamMember'); | ||
// | ||
// $invitationId = $user->currentTeam->fresh()->teamInvitations->first()->id; | ||
// | ||
// // Cancel the team invitation... | ||
// $component->call('cancelTeamInvitation', $invitationId); | ||
// | ||
// expect($user->currentTeam->fresh()->teamInvitations)->toHaveCount(0); | ||
//})->skip(function () { | ||
// return ! Features::sendsTeamInvitations(); | ||
//}, 'Team invitations not enabled.'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.