-
Notifications
You must be signed in to change notification settings - Fork 5
test: resturcture team tests into a dedicated directory #1324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR restructures team-related tests by moving them into a dedicated tests/Feature/Team/ directory and adds a new test file for team invitation emails. The restructuring improves test organization by grouping related functionality together.
Key changes:
- Namespace updates for seven existing team test files to reflect the new directory structure
- Addition of a new TeamMailTest.php file with comprehensive tests for the TeamInvitation mailable
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Feature/Team/UpdateTeamNameTest.php | Namespace updated from Tests\Feature to Tests\Feature\Team |
| tests/Feature/Team/UpdateTeamMemberRoleTest.php | Namespace updated from Tests\Feature to Tests\Feature\Team |
| tests/Feature/Team/TeamMailTest.php | New test file added with unit tests for TeamInvitation mailable functionality |
| tests/Feature/Team/RemoveTeamMemberTest.php | Namespace updated from Tests\Feature to Tests\Feature\Team |
| tests/Feature/Team/LeaveTeamTest.php | Namespace updated from Tests\Feature to Tests\Feature\Team |
| tests/Feature/Team/InviteTeamMemberTest.php | Namespace updated from Tests\Feature to Tests\Feature\Team |
| tests/Feature/Team/DeleteTeamTest.php | Namespace updated from Tests\Feature to Tests\Feature\Team |
| tests/Feature/Team/CreateTeamTest.php | Namespace updated from Tests\Feature to Tests\Feature\Team |
| $invitation = TeamInvitationModel::create([ | ||
| 'team_id' => $this->team->id, | ||
| 'email' => '[email protected]', | ||
| 'role' => 'editor', | ||
| ]); |
Copilot
AI
Dec 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TeamInvitation records are being created directly without using a factory. The codebase has factories for similar models (ProjectInvitationFactory, StudyInvitationFactory). Consider creating a TeamInvitationFactory to follow the established pattern and make test data creation more maintainable.
| $invitation = TeamInvitationModel::create([ | ||
| 'team_id' => $this->team->id, | ||
| 'email' => '[email protected]', | ||
| 'role' => 'editor', | ||
| ]); |
Copilot
AI
Dec 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TeamInvitation records are being created directly without using a factory. The codebase has factories for similar models (ProjectInvitationFactory, StudyInvitationFactory). Consider creating a TeamInvitationFactory to follow the established pattern and make test data creation more maintainable.
| $invitation = TeamInvitationModel::create([ | ||
| 'team_id' => $this->team->id, | ||
| 'email' => '[email protected]', | ||
| 'role' => 'editor', | ||
| ]); |
Copilot
AI
Dec 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TeamInvitation records are being created directly without using a factory. The codebase has factories for similar models (ProjectInvitationFactory, StudyInvitationFactory). Consider creating a TeamInvitationFactory to follow the established pattern and make test data creation more maintainable.
| $invitation = TeamInvitationModel::create([ | ||
| 'team_id' => $anotherTeam->id, | ||
| 'email' => '[email protected]', | ||
| 'role' => 'editor', | ||
| ]); |
Copilot
AI
Dec 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TeamInvitation records are being created directly without using a factory. The codebase has factories for similar models (ProjectInvitationFactory, StudyInvitationFactory). Consider creating a TeamInvitationFactory to follow the established pattern and make test data creation more maintainable.
| $invitation = TeamInvitationModel::create([ | ||
| 'team_id' => $this->team->id, | ||
| 'email' => '[email protected]', | ||
| 'role' => 'editor', |
Copilot
AI
Dec 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The role 'editor' is not a valid Jetstream role for this application. According to JetstreamServiceProvider, the valid roles are 'owner', 'collaborator', and 'reviewer'. Using an invalid role may cause issues when the invitation is processed.
| $invitation = TeamInvitationModel::create([ | ||
| 'team_id' => $this->team->id, | ||
| 'email' => '[email protected]', | ||
| 'role' => 'editor', |
Copilot
AI
Dec 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The role 'editor' is not a valid Jetstream role for this application. According to JetstreamServiceProvider, the valid roles are 'owner', 'collaborator', and 'reviewer'. Using an invalid role may cause issues when the invitation is processed.
| $invitation = TeamInvitationModel::create([ | ||
| 'team_id' => $this->team->id, | ||
| 'email' => '[email protected]', | ||
| 'role' => 'editor', |
Copilot
AI
Dec 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The role 'editor' is not a valid Jetstream role for this application. According to JetstreamServiceProvider, the valid roles are 'owner', 'collaborator', and 'reviewer'. Using an invalid role may cause issues when the invitation is processed.
|
|
||
| public function test_team_invitation_mail_handles_different_roles(): void | ||
| { | ||
| $roles = ['admin', 'editor']; |
Copilot
AI
Dec 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The roles 'admin' and 'editor' are not valid Jetstream roles for this application. According to JetstreamServiceProvider, the valid roles are 'owner', 'collaborator', and 'reviewer'. The tests should use these valid roles instead.
| $invitation = TeamInvitationModel::create([ | ||
| 'team_id' => $this->team->id, | ||
| 'email' => "invitee-{$role}@example.com", | ||
| 'role' => $role, | ||
| ]); |
Copilot
AI
Dec 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TeamInvitation records are being created directly without using a factory. The codebase has factories for similar models (ProjectInvitationFactory, StudyInvitationFactory). Consider creating a TeamInvitationFactory to follow the established pattern and make test data creation more maintainable.
| $invitation = TeamInvitationModel::create([ | ||
| 'team_id' => $anotherTeam->id, | ||
| 'email' => '[email protected]', | ||
| 'role' => 'editor', |
Copilot
AI
Dec 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The role 'editor' is not a valid Jetstream role for this application. According to JetstreamServiceProvider, the valid roles are 'owner', 'collaborator', and 'reviewer'. Using an invalid role may cause issues when the invitation is processed.
No description provided.