Add failing test

This commit is contained in:
Marcus Moore 2024-03-25 13:46:22 -07:00
parent 83ef7c6fe8
commit 675717ff82
No known key found for this signature in database

View file

@ -113,6 +113,20 @@ class AssetStoreTest extends TestCase
$this->assertNull($asset->last_audit_date);
}
public function testNonDateUsedForLastAuditDateReturnsValidationError()
{
$response = $this->actingAsForApi(User::factory()->superuser()->create())
->postJson(route('api.assets.store'), [
'last_audit_date' => 'this-is-not-valid',
'asset_tag' => '1234',
'model_id' => AssetModel::factory()->create()->id,
'status_id' => Statuslabel::factory()->create()->id,
])
->assertStatusMessageIs('error');
$this->assertNotNull($response->json('messages.last_audit_date'));
}
public function testArchivedDepreciateAndPhysicalCanBeNull()
{
$model = AssetModel::factory()->ipadModel()->create();