mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-09 00:32:15 +01:00
Added mail to inform users about still running time entries
This commit is contained in:
committed by
Constantin Graf
parent
855db81104
commit
8db0a7d25e
32
tests/Unit/Mail/TimeEntryStillRunningMailTest.php
Normal file
32
tests/Unit/Mail/TimeEntryStillRunningMailTest.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\Unit\Mail;
|
||||
|
||||
use App\Mail\TimeEntryStillRunningMail;
|
||||
use App\Models\TimeEntry;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\UsesClass;
|
||||
use Tests\TestCaseWithDatabase;
|
||||
|
||||
#[CoversClass(TimeEntryStillRunningMail::class)]
|
||||
#[UsesClass(TimeEntryStillRunningMail::class)]
|
||||
class TimeEntryStillRunningMailTest extends TestCaseWithDatabase
|
||||
{
|
||||
public function test_mail_renders_content_correctly(): void
|
||||
{
|
||||
// Arrange
|
||||
$user = $this->createUserWithPermission();
|
||||
$timeEntry = TimeEntry::factory()->create([
|
||||
'description' => 'TEST 123',
|
||||
]);
|
||||
$mail = new TimeEntryStillRunningMail($timeEntry, $user->user);
|
||||
|
||||
// Act
|
||||
$rendered = $mail->render();
|
||||
|
||||
// Assert
|
||||
$this->assertStringContainsString('Your currently running time entry "TEST 123"', $rendered);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user