Added week start

This commit is contained in:
Constantin Graf
2024-03-21 13:53:05 +01:00
parent fb04cff7c1
commit fc5b35661d
15 changed files with 364 additions and 67 deletions

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace Tests\Feature;
use App\Enums\Weekday;
use App\Models\User;
use App\Service\TimezoneService;
use Illuminate\Foundation\Testing\RefreshDatabase;
@@ -24,10 +25,15 @@ class ProfileInformationTest extends TestCase
'name' => 'Test Name',
'email' => 'test@example.com',
'timezone' => app(TimezoneService::class)->getTimezones()[0],
'week_start' => Weekday::Sunday->value,
]);
// Assert
$this->assertEquals('Test Name', $user->fresh()->name);
$this->assertEquals('test@example.com', $user->fresh()->email);
$response->assertValid(errorBag: 'updateProfileInformation');
$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(Weekday::Sunday, $user->week_start);
}
}