Added billable rates; Added project members; Added visibility to projects

This commit is contained in:
Constantin Graf
2024-03-28 18:50:04 +01:00
parent bb42b0940a
commit ba0212ea01
71 changed files with 3236 additions and 174 deletions

View File

@@ -39,6 +39,7 @@ class RegistrationTest extends TestCase
public function test_new_users_can_register(): void
{
// Act
$response = $this->post('/register', [
'name' => 'Test User',
'email' => 'test@example.com',
@@ -47,6 +48,7 @@ class RegistrationTest extends TestCase
'terms' => Jetstream::hasTermsAndPrivacyPolicyFeature(),
]);
// Assert
$this->assertAuthenticated();
$response->assertRedirect(RouteServiceProvider::HOME);
$user = User::where('email', 'test@example.com')->firstOrFail();

View File

@@ -14,13 +14,21 @@ class UpdateTeamNameTest extends TestCase
public function test_team_names_can_be_updated(): void
{
$this->actingAs($user = User::factory()->withPersonalOrganization()->create());
// Arrange
$user = User::factory()->withPersonalOrganization()->create();
$this->actingAs($user);
// Act
$response = $this->put('/teams/'.$user->currentTeam->id, [
'name' => 'Test Organization',
'currency' => 'USD',
]);
// Assert
$response->assertValid(errorBag: 'updateTeamName');
$this->assertCount(1, $user->fresh()->ownedTeams);
$this->assertEquals('Test Organization', $user->currentTeam->fresh()->name);
$organization = $user->currentTeam->fresh();
$this->assertEquals('Test Organization', $organization->name);
$this->assertEquals('USD', $organization->currency);
}
}