mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-14 17:44:17 -08:00
Fixed tests, updated CSV
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
220902a8b4
commit
4afe873f24
|
@ -108,8 +108,9 @@ class AssetModelImporter extends ItemImporter
|
|||
return $assetmodel;
|
||||
|
||||
} else {
|
||||
Log::debug($assetmodel->getErrors());
|
||||
return $assetmodel->errors;
|
||||
$this->log($assetmodel->getErrors()->first());
|
||||
$this->addErrorToBag($assetmodel, '', $assetmodel->getErrors()->first());
|
||||
return $assetmodel->getErrors();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,23 +1,27 @@
|
|||
Name,Category,Manufacturer,Notes,Model Number,Fieldset,Requestable
|
||||
Changed Test Model,Laptops,Berge Inc,"Sphinx of black quartz, judge my vow",1786VM80X07,Laptops and Desktops,Y
|
||||
Test Model 2,Laptops,"Botsford, Boyle and Herzog",ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae mauris viverra diam vitae quam suspendisse potenti nullam,9351IS25A51,Laptops and Desktops,Y
|
||||
Test Model 3,Laptops,Pollich LLC,,9929FR08W85,Laptops and Desktops,Y
|
||||
Test Model 4,Laptops,Walker-Towne,neque vestibulum eget vulputate ut ultrices vel augue vestibulum ante ipsum primis in faucibus orci luctus,9139KQ78G81,Laptops and Desktops,Y
|
||||
Test Model 5,Laptops,Berge Inc,turpis adipiscing lorem vitae mattis nibh ligula nec sem duis aliquam convallis nunc proin at turpis a pede,0910VB28Q61,Laptops and Desktops,Y
|
||||
Test Model 6,Laptops,"Heaney, Altenwerth and Emmerich",,7375EM02N97,Laptops and Desktops,Y
|
||||
Test Model 7,Desktops,"Romaguera, Goldner and Crooks",Test Updated Text,,Laptops and Desktops,Y
|
||||
Test Model 8,Laptops,Watsica LLC,sapien urna pretium nisl ut volutpat sapien arcu sed augue aliquam erat volutpat in,,Laptops and Desktops,Y
|
||||
Test Model 9,Laptops,"Fritsch, Sauer and Conn",orci luctus et ultrices posuere cubilia curae duis faucibus accumsan odio curabitur,,Laptops and Desktops,Y
|
||||
Test Model 10,Laptops,"Upton, Feil and Jast",velit vivamus vel nulla eget eros elementum pellentesque quisque porta volutpat,,Laptops and Desktops,Y
|
||||
Test Model 11,Laptops,Berge Inc,sed nisl nunc rhoncus dui vel sem sed sagittis nam congue risus semper porta volutpat quam pede lobortis ligula sit,,Laptops and Desktops,Y
|
||||
Test Model 12,Laptops,"Kutch, Johnson and Olson",curae mauris viverra diam vitae quam suspendisse potenti nullam porttitor lacus at turpis donec posuere metus vitae ipsum aliquam non,,Laptops and Desktops,Y
|
||||
Test Model 13,Laptops,Mosciski Inc,molestie hendrerit at vulputate vitae nisl aenean lectus pellentesque eget nunc donec quis orci,,Laptops and Desktops,Y
|
||||
Test Model 14,Laptops,Mosciski Inc,egestas metus aenean fermentum donec ut mauris eget massa tempor convallis nulla neque libero convallis eget eleifend,,Laptops and Desktops,N
|
||||
Test Model 15,Laptops,"Upton, Feil and Jast",,,Laptops and Desktops,N
|
||||
Test Model 16,Laptops,"Romaguera, Goldner and Crooks",dui luctus rutrum nulla tellus in sagittis dui vel nisl duis ac nibh fusce,2315CN41G71,Laptops and Desktops,N
|
||||
Test Model 17,Laptops,Abernathy-Stamm,maecenas pulvinar lobortis est phasellus sit amet erat nulla tempus,6080UE59E09,Laptops and Desktops,N
|
||||
Test Model 18,Laptops,Mosciski Inc,,5505YF23M46,Laptops and Desktops,N
|
||||
Test Model 19,Laptops,Walker-Towne,,8673QP30R80,Laptops and Desktops,Y
|
||||
Test Model 20,Mobile Phones,"Heaney, Altenwerth and Emmerich",nisl ut volutpat sapien arcu sed augue aliquam erat volutpat in congue etiam justo etiam pretium,9088XV67Q94,Mobile Devices,Y
|
||||
Test One,Mobile Phones,Okuneva Group,quis libero nullam sit amet turpis elementum ligula vehicula consequat morbi a ipsum integer a nibh in quis,,Mobile Devices,Y
|
||||
Test Missing Category,,,orci luctus et ultrices posuere cubilia curae duis faucibus accumsan odio curabitur,,,
|
||||
Name,Category,Manufacturer,Notes,Model Number,Fieldset,Requestable,EOL,Min Qty
|
||||
Changed Test Model,Laptops,Blargh,"Sphinx of black quartz, judge my vow",1786VM80X07,Laptops and Desktops,Y,36,100
|
||||
Test Model 2,Laptops,"Botsford, Boyle and Herzog",ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae mauris viverra diam vitae quam suspendisse potenti nullam,9351IS25A51,Laptops and Desktops,Y,36,50
|
||||
Test Model 3,Laptops,Pollich LLC,,9929FR08W85,Laptops and Desktops,Y,36,30
|
||||
,Laptops,Walker-Towne,neque vestibulum eget vulputate ut ultrices vel augue vestibulum ante ipsum primis in faucibus orci luctus,9139KQ78G81,Laptops and Desktops,Y,36,
|
||||
Test Model 5,Laptops,Berge Inc,turpis adipiscing lorem vitae mattis nibh ligula nec sem duis aliquam convallis nunc proin at turpis a pede,0910VB28Q61,Laptops and Desktops,Y,36,0
|
||||
Test Model 6,Laptops,"Heaney, Altenwerth and Emmerich",,7375EM02N97,Laptops and Desktops,Y,36,100
|
||||
Test Model 7,Desktops,"Romaguera, Goldner and Crooks",Test Updated Text,,Laptops and Desktops,Y,36,100
|
||||
Test Model 8,Laptops,Watsica LLC,sapien urna pretium nisl ut volutpat sapien arcu sed augue aliquam erat volutpat in,,Laptops and Desktops,Y,36,100
|
||||
Test Model 9,Laptops,"Fritsch, Sauer and Conn",orci luctus et ultrices posuere cubilia curae duis faucibus accumsan odio curabitur,,Laptops and Desktops,Y,36,100
|
||||
Test Model 10,Laptops,"Upton, Feil and Jast",velit vivamus vel nulla eget eros elementum pellentesque quisque porta volutpat,,Laptops and Desktops,Y,36,100
|
||||
Test Model 11,Laptops,Berge Inc,sed nisl nunc rhoncus dui vel sem sed sagittis nam congue risus semper porta volutpat quam pede lobortis ligula sit,,Laptops and Desktops,Y,36,100
|
||||
Test Model 12,Laptops,"Kutch, Johnson and Olson",curae mauris viverra diam vitae quam suspendisse potenti nullam porttitor lacus at turpis donec posuere metus vitae ipsum aliquam non,,Laptops and Desktops,Y,36,100
|
||||
Test Model 13,Laptops,Mosciski Inc,molestie hendrerit at vulputate vitae nisl aenean lectus pellentesque eget nunc donec quis orci,,Laptops and Desktops,Y,36,100
|
||||
Test Model 14,Laptops,Mosciski Inc,egestas metus aenean fermentum donec ut mauris eget massa tempor convallis nulla neque libero convallis eget eleifend,,Laptops and Desktops,N,36,100
|
||||
Test Model 15,Laptops,"Upton, Feil and Jast",,,Laptops and Desktops,N,36,100
|
||||
Test Model 16,Laptops,"Romaguera, Goldner and Crooks",dui luctus rutrum nulla tellus in sagittis dui vel nisl duis ac nibh fusce,2315CN41G71,Laptops and Desktops,N,36,100
|
||||
Test Model 17,Laptops,Abernathy-Stamm,maecenas pulvinar lobortis est phasellus sit amet erat nulla tempus,6080UE59E09,Laptops and Desktops,N,36,100
|
||||
Test Model 18,Laptops,Mosciski Inc,,5505YF23M46,Laptops and Desktops,N,36,100
|
||||
Test Model 19,Laptops,Walker-Towne,,8673QP30R80,Laptops and Desktops,Y,36,100
|
||||
Test Model 20,Mobile Phones,"Heaney, Altenwerth and Emmerich",nisl ut volutpat sapien arcu sed augue aliquam erat volutpat in congue etiam justo etiam pretium,9088XV67Q94,Mobile Devices,Y,12,100
|
||||
Test One,Mobile Phones,Okuneva Group,quis libero nullam sit amet turpis elementum ligula vehicula consequat morbi a ipsum integer a nibh in quis,,Mobile Devices,Y,12,100
|
||||
Test Missing Category,,,orci luctus et ultrices posuere cubilia curae duis faucibus accumsan odio curabitur,,,Y,30,100
|
||||
One more category,Mobile Phones News,Walker-Towne,"Sphinx of black quartz, judge my vow",,New Fieldset from Improt,Y,30,100
|
||||
Aaaand one more yes,Mobile Phones,Walker-Towne,"Sphinx of black quartz, judge my vow",,New Fieldset from Improt,Y,30,100
|
||||
One more no,Mobile Phones,Walker-Towne,"Sphinx of black quartz, judge my vow",,New Fieldset from Improt,N,30,100
|
||||
Aaaand one more yes yes,Mobile Phones,Walker-Towne,sdfgsdgsdfg,dsfgsdfgsdfgsdg,New Fieldset from Improt,Y,30,100
|
|
|
@ -92,7 +92,7 @@ class ImportAssetModelsTest extends ImportDataTestCase implements TestsPermissio
|
|||
#[Test]
|
||||
public function whenRequiredColumnsAreMissingInImportFile(): void
|
||||
{
|
||||
$importFileBuilder = ImportFileBuilder::new()->forget(['category']);
|
||||
$importFileBuilder = ImportFileBuilder::new(['name' => '']);
|
||||
$import = Import::factory()->assetmodel()->create(['file_path' => $importFileBuilder->saveToImportsDirectory()]);
|
||||
|
||||
$this->actingAsForApi(User::factory()->superuser()->create());
|
||||
|
@ -104,7 +104,10 @@ class ImportAssetModelsTest extends ImportDataTestCase implements TestsPermissio
|
|||
'payload' => null,
|
||||
'messages' => [
|
||||
'' => [
|
||||
'name' => ['The name field is required.'],
|
||||
'' => [
|
||||
'' =>
|
||||
['The name field is required.'],
|
||||
],
|
||||
]
|
||||
]
|
||||
]);
|
||||
|
|
Loading…
Reference in a new issue