Fixed tests

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2024-11-13 15:16:18 +00:00
parent abab062756
commit f87ebb4710

View file

@ -92,7 +92,7 @@ class ImportAssetModelsTest extends ImportDataTestCase implements TestsPermissio
#[Test]
public function whenRequiredColumnsAreMissingInImportFile(): void
{
$importFileBuilder = ImportFileBuilder::new(['name' => ''])->forget(['category']);
$importFileBuilder = ImportFileBuilder::new()->forget(['category']);
$import = Import::factory()->assetmodel()->create(['file_path' => $importFileBuilder->saveToImportsDirectory()]);
$this->actingAsForApi(User::factory()->superuser()->create());
@ -121,9 +121,8 @@ class ImportAssetModelsTest extends ImportDataTestCase implements TestsPermissio
public function updateAssetModelFromImport(): void
{
$assetmodel = AssetModel::factory()->create()->refresh();
$new_model_number = Str::random();
$importFileBuilder = ImportFileBuilder::new(['name' => $assetmodel->name, 'model_number' => Str::random(), 'category_id' => $assetmodel->category_id]);
$category = Category::find($assetmodel->category->name);
$importFileBuilder = ImportFileBuilder::new(['name' => $assetmodel->name, 'model_number' => Str::random(), 'category' => $category]);
$row = $importFileBuilder->firstRow();
$import = Import::factory()->assetmodel()->create(['file_path' => $importFileBuilder->saveToImportsDirectory()]);