Added tests

This commit is contained in:
Constantin Graf
2024-04-15 19:25:09 +02:00
parent feb70910c7
commit eea5a3d01b
8 changed files with 87 additions and 2 deletions

View File

@@ -31,13 +31,14 @@ class ProfileInformationTest extends TestCase
{
// Arrange
$user = User::factory()->create();
$timezone = app(TimezoneService::class)->getTimezones()[0];
$this->actingAs($user);
// Act
$response = $this->put('/user/profile-information', [
'name' => 'Test Name',
'email' => 'test@example.com',
'timezone' => app(TimezoneService::class)->getTimezones()[0],
'timezone' => $timezone,
'week_start' => Weekday::Sunday->value,
]);
@@ -46,7 +47,7 @@ class ProfileInformationTest extends TestCase
$user = $user->fresh();
$this->assertEquals('Test Name', $user->name);
$this->assertEquals('test@example.com', $user->email);
$this->assertEquals(app(TimezoneService::class)->getTimezones()[0], $user->timezone);
$this->assertEquals($timezone, $user->timezone);
$this->assertEquals(Weekday::Sunday, $user->week_start);
}
}