Add Fortify auth, Flux dark mode, demo seed, and Docker hot reload.
Protect recordings per user, seed a demo login on container start, and bind-mount the app with Vite HMR for local Compose development.
This commit is contained in:
@@ -5,6 +5,7 @@ namespace Tests\Feature;
|
||||
use App\Http\Requests\StoreRecordingRequest;
|
||||
use App\Jobs\TranscribeRecording;
|
||||
use App\Models\Recording;
|
||||
use App\Models\User;
|
||||
use App\Services\TranscriptionService;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Http\UploadedFile;
|
||||
@@ -17,9 +18,20 @@ class RecordingUploadTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
protected User $user;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->user = User::factory()->create();
|
||||
$this->actingAs($this->user);
|
||||
}
|
||||
|
||||
public function test_index_shows_recordings(): void
|
||||
{
|
||||
Recording::query()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'title' => 'Pocket note',
|
||||
'original_filename' => 'note.mp3',
|
||||
'file_path' => 'recordings/note.mp3',
|
||||
@@ -150,6 +162,7 @@ class RecordingUploadTest extends TestCase
|
||||
public function test_user_can_queue_local_transcription(): void
|
||||
{
|
||||
$recording = Recording::query()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'title' => 'Dictation',
|
||||
'original_filename' => 'dictation.mp3',
|
||||
'file_path' => 'recordings/dictation.mp3',
|
||||
@@ -173,6 +186,7 @@ class RecordingUploadTest extends TestCase
|
||||
public function test_transcription_status_endpoint_returns_progress(): void
|
||||
{
|
||||
$recording = Recording::query()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'title' => 'Live status',
|
||||
'original_filename' => 'live.mp3',
|
||||
'file_path' => 'recordings/live.mp3',
|
||||
@@ -201,6 +215,7 @@ class RecordingUploadTest extends TestCase
|
||||
Transcription::fake(['Hello from the recorder.']);
|
||||
|
||||
$recording = Recording::query()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'title' => 'Sample',
|
||||
'original_filename' => 'sample.mp3',
|
||||
'file_path' => 'recordings/sample.mp3',
|
||||
@@ -229,6 +244,7 @@ class RecordingUploadTest extends TestCase
|
||||
});
|
||||
|
||||
$recording = Recording::query()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'title' => 'Bad',
|
||||
'original_filename' => 'bad.mp3',
|
||||
'file_path' => 'recordings/bad.mp3',
|
||||
@@ -252,6 +268,7 @@ class RecordingUploadTest extends TestCase
|
||||
public function test_orphaned_processing_is_recovered_on_status_poll(): void
|
||||
{
|
||||
$recording = Recording::query()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'title' => 'Stuck',
|
||||
'original_filename' => 'stuck.mp3',
|
||||
'file_path' => 'recordings/stuck.mp3',
|
||||
@@ -277,6 +294,7 @@ class RecordingUploadTest extends TestCase
|
||||
public function test_recent_processing_is_not_marked_orphaned(): void
|
||||
{
|
||||
$recording = Recording::query()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'title' => 'Still working',
|
||||
'original_filename' => 'working.mp3',
|
||||
'file_path' => 'recordings/working.mp3',
|
||||
@@ -303,6 +321,7 @@ class RecordingUploadTest extends TestCase
|
||||
Transcription::fake(['Recovered transcript.']);
|
||||
|
||||
$recording = Recording::query()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'title' => 'Restart me',
|
||||
'original_filename' => 'restart.mp3',
|
||||
'file_path' => 'recordings/restart.mp3',
|
||||
@@ -324,6 +343,7 @@ class RecordingUploadTest extends TestCase
|
||||
public function test_user_can_stop_an_active_transcription(): void
|
||||
{
|
||||
$recording = Recording::query()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'title' => 'Stop me',
|
||||
'original_filename' => 'stop.mp3',
|
||||
'file_path' => 'recordings/stop.mp3',
|
||||
@@ -350,6 +370,7 @@ class RecordingUploadTest extends TestCase
|
||||
Transcription::fake(['Restarted transcript.']);
|
||||
|
||||
$recording = Recording::query()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'title' => 'Restart me while busy',
|
||||
'original_filename' => 'switch.mp3',
|
||||
'file_path' => 'recordings/switch.mp3',
|
||||
@@ -377,6 +398,7 @@ class RecordingUploadTest extends TestCase
|
||||
Transcription::fake(['Should be ignored.']);
|
||||
|
||||
$recording = Recording::query()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'title' => 'Ignore late job',
|
||||
'original_filename' => 'ignore.mp3',
|
||||
'file_path' => 'recordings/ignore.mp3',
|
||||
@@ -400,6 +422,7 @@ class RecordingUploadTest extends TestCase
|
||||
public function test_recordings_can_be_searched_by_transcript(): void
|
||||
{
|
||||
Recording::query()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'title' => 'Office chat',
|
||||
'original_filename' => 'office.mp3',
|
||||
'file_path' => 'recordings/office.mp3',
|
||||
@@ -409,6 +432,7 @@ class RecordingUploadTest extends TestCase
|
||||
]);
|
||||
|
||||
Recording::query()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'title' => 'Kitchen note',
|
||||
'original_filename' => 'kitchen.mp3',
|
||||
'file_path' => 'recordings/kitchen.mp3',
|
||||
@@ -429,6 +453,7 @@ class RecordingUploadTest extends TestCase
|
||||
Bus::fake();
|
||||
|
||||
$recording = Recording::query()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'title' => 'Keep me',
|
||||
'original_filename' => 'keep.mp3',
|
||||
'file_path' => 'recordings/keep.mp3',
|
||||
@@ -454,6 +479,7 @@ class RecordingUploadTest extends TestCase
|
||||
Bus::fake();
|
||||
|
||||
Recording::query()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'title' => 'Needs work',
|
||||
'original_filename' => 'needs.mp3',
|
||||
'file_path' => 'recordings/needs.mp3',
|
||||
@@ -462,6 +488,7 @@ class RecordingUploadTest extends TestCase
|
||||
]);
|
||||
|
||||
Recording::query()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'title' => 'Already done',
|
||||
'original_filename' => 'done.mp3',
|
||||
'file_path' => 'recordings/done.mp3',
|
||||
@@ -481,6 +508,7 @@ class RecordingUploadTest extends TestCase
|
||||
public function test_index_shows_human_status_labels(): void
|
||||
{
|
||||
Recording::query()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'title' => 'Label check',
|
||||
'original_filename' => 'label.mp3',
|
||||
'file_path' => 'recordings/label.mp3',
|
||||
|
||||
Reference in New Issue
Block a user