Separate share transfers from Files storage and add folder upload to New transfer.
Deploy Ladill Transfer / deploy (push) Successful in 28s
Deploy Ladill Transfer / deploy (push) Successful in 28s
Transfers lists only intentional shares while Files shows all storage, and New transfer accepts folder picks with flattened file uploads. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -113,13 +113,72 @@ class TransferFilesTest extends TestCase
|
||||
->assertSee('BKC');
|
||||
}
|
||||
|
||||
public function test_transfers_index_excludes_files_page_storage(): void
|
||||
{
|
||||
Storage::fake('qr');
|
||||
$this->fakeTransferBillingApi();
|
||||
|
||||
$user = $this->createUser();
|
||||
$folder = $this->createFolder($user, 'Private folder');
|
||||
|
||||
$this->actingAs($user)
|
||||
->postJson(route('transfer.files.upload'), [
|
||||
'upload_folder_name' => 'Uploaded folder',
|
||||
'files' => [UploadedFile::fake()->create('secret.txt', 10, 'text/plain')],
|
||||
])
|
||||
->assertOk();
|
||||
|
||||
$this->actingAs($user)
|
||||
->post(route('transfer.transfers.store'), [
|
||||
'title' => 'Shared deck',
|
||||
'files' => [UploadedFile::fake()->create('deck.pdf', 50, 'application/pdf')],
|
||||
])
|
||||
->assertRedirect();
|
||||
|
||||
$this->actingAs($user)
|
||||
->get(route('transfer.transfers.index'))
|
||||
->assertOk()
|
||||
->assertSee('Shared deck')
|
||||
->assertDontSee('Private folder')
|
||||
->assertDontSee('Uploaded folder');
|
||||
}
|
||||
|
||||
public function test_files_index_shows_root_storage_and_share_files(): void
|
||||
{
|
||||
Storage::fake('qr');
|
||||
$this->fakeTransferBillingApi();
|
||||
|
||||
$user = $this->createUser();
|
||||
|
||||
$this->actingAs($user)
|
||||
->post(route('transfer.files.upload'), [
|
||||
'files' => [UploadedFile::fake()->create('stored.txt', 10, 'text/plain')],
|
||||
])
|
||||
->assertRedirect();
|
||||
|
||||
$this->actingAs($user)
|
||||
->post(route('transfer.transfers.store'), [
|
||||
'title' => 'Shared deck',
|
||||
'files' => [UploadedFile::fake()->create('deck.pdf', 50, 'application/pdf')],
|
||||
])
|
||||
->assertRedirect();
|
||||
|
||||
$this->actingAs($user)
|
||||
->get(route('transfer.files.index'))
|
||||
->assertOk()
|
||||
->assertSee('stored.txt')
|
||||
->assertSee('deck.pdf');
|
||||
}
|
||||
|
||||
public function test_upload_detects_duplicate_filenames(): void
|
||||
{
|
||||
Storage::fake('qr');
|
||||
$this->fakeTransferBillingApi();
|
||||
|
||||
$user = $this->createUser();
|
||||
$this->createShareTransfer($user, 'Docs', 'brief.pdf');
|
||||
$this->actingAs($user)->post(route('transfer.files.upload'), [
|
||||
'files' => [UploadedFile::fake()->create('brief.pdf', 50, 'application/pdf')],
|
||||
])->assertRedirect();
|
||||
|
||||
$this->actingAs($user)
|
||||
->postJson(route('transfer.files.upload.check'), [
|
||||
@@ -135,7 +194,9 @@ class TransferFilesTest extends TestCase
|
||||
$this->fakeTransferBillingApi();
|
||||
|
||||
$user = $this->createUser();
|
||||
$this->createShareTransfer($user, 'Docs', 'brief.pdf');
|
||||
$this->actingAs($user)->post(route('transfer.files.upload'), [
|
||||
'files' => [UploadedFile::fake()->create('brief.pdf', 50, 'application/pdf')],
|
||||
])->assertRedirect();
|
||||
|
||||
$this->actingAs($user)
|
||||
->post(route('transfer.files.upload'), [
|
||||
@@ -144,7 +205,7 @@ class TransferFilesTest extends TestCase
|
||||
])
|
||||
->assertRedirect();
|
||||
|
||||
$this->assertSame(1, \App\Models\TransferFile::query()->count());
|
||||
$this->assertSame(1, \App\Models\TransferFile::query()->where('original_name', 'brief.pdf')->count());
|
||||
$this->assertDatabaseHas('transfer_files', ['original_name' => 'brief.pdf']);
|
||||
}
|
||||
|
||||
@@ -154,7 +215,9 @@ class TransferFilesTest extends TestCase
|
||||
$this->fakeTransferBillingApi();
|
||||
|
||||
$user = $this->createUser();
|
||||
$this->createShareTransfer($user, 'Docs', 'brief.pdf');
|
||||
$this->actingAs($user)->post(route('transfer.files.upload'), [
|
||||
'files' => [UploadedFile::fake()->create('brief.pdf', 50, 'application/pdf')],
|
||||
])->assertRedirect();
|
||||
|
||||
$this->actingAs($user)
|
||||
->post(route('transfer.files.upload'), [
|
||||
|
||||
Reference in New Issue
Block a user