fix(backups): render form for directory-only targets (#11332)
This commit is contained in:
parent
5152698757
commit
db1316f878
2 changed files with 13 additions and 1 deletions
|
|
@ -82,7 +82,7 @@ public function mount(): void
|
|||
'type' => 'Directory',
|
||||
'name' => $directory->fs_path,
|
||||
]);
|
||||
$this->targets = $volumes->concat($directories)->values();
|
||||
$this->targets = collect($volumes->concat($directories)->all())->values();
|
||||
$this->targetKey = $this->selectedTargetKey ?? data_get($this->targets->first(), 'key');
|
||||
$this->loadSelectedBackup();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -222,6 +222,18 @@
|
|||
expect(ScheduledVolumeBackup::query()->sole()->backupable->is($directory))->toBeTrue();
|
||||
});
|
||||
|
||||
it('renders the backup form for an application with only a directory target', function () {
|
||||
$team = Team::factory()->create();
|
||||
signInForVolumeBackups($this, $team);
|
||||
[$application, $volume] = createVolumeBackupApplication($team);
|
||||
$volume->delete();
|
||||
$directory = createApplicationBackupDirectory($application);
|
||||
|
||||
Livewire::test(CreateScheduledVolumeBackup::class, ['application' => $application])
|
||||
->assertSet('targetKey', 'directory:'.$directory->id)
|
||||
->assertSuccessful();
|
||||
});
|
||||
|
||||
it('rejects files and directory mounts owned by another application as backup targets', function () {
|
||||
$team = Team::factory()->create();
|
||||
signInForVolumeBackups($this, $team);
|
||||
|
|
|
|||
Loading…
Reference in a new issue