export {ImageManager} from './image-manager';
export {ImagePicker} from './image-picker';
export {ListSortControl} from './list-sort-control';
-export {LoadingButton} from './loading-button';
+export {LoadingButton} from './loading-button.ts';
export {MarkdownEditor} from './markdown-editor';
export {NewUserPassword} from './new-user-password';
export {Notification} from './notification';
updateCount() {
const count = this.getCommentCount();
- console.log('update count', count, this.container);
this.commentsTitle.textContent = window.$trans.choice(this.countText, count, {count});
}
$resp->assertRedirect("/import/{$import->id}");
$this->assertFileExists(storage_path($import->path));
$this->assertActivityExists(ActivityType::IMPORT_CREATE);
+
+ ZipTestHelper::deleteZipForImport($import);
}
public function test_import_show_page()
$resp = $this->followRedirects($resp);
$resp->assertSeeText('The name field is required.');
$resp->assertSeeText('The id must be an integer.');
+
+ ZipTestHelper::deleteZipForImport($import);
}
public function test_run_checks_permissions_on_import()
$resp = $this->followRedirects($resp);
$resp->assertSeeText('You are lacking the required permissions to create books.');
+
+ ZipTestHelper::deleteZipForImport($import);
}
public function test_run_requires_parent_for_chapter_and_page_imports()
$resp = $this->followRedirects($resp);
$resp->assertSee('Parent book required for chapter import.');
+
+ ZipTestHelper::deleteZipForImport($import);
}
protected function runImportFromFile(UploadedFile $file): TestResponse
$import = Import::factory()->create($importData);
$zip = static::zipUploadFromData($zipData, $files);
- rename($zip->getRealPath(), storage_path($import->path));
+ $targetPath = storage_path($import->path);
+ $targetDir = dirname($targetPath);
+
+ if (!file_exists($targetDir)) {
+ mkdir($targetDir);
+ }
+
+ rename($zip->getRealPath(), $targetPath);
return $import;
}