mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-26 22:19:41 -08:00
Implement test
This commit is contained in:
parent
31a75bd252
commit
b653d19579
|
@ -35,7 +35,7 @@ class AssetCheckinTest extends TestCase
|
||||||
$this->markTestIncomplete();
|
$this->markTestIncomplete();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testAssetCheckedOutToUserCanBeCheckedIn()
|
public function testAssetCanBeCheckedIn()
|
||||||
{
|
{
|
||||||
Event::fake([CheckoutableCheckedIn::class]);
|
Event::fake([CheckoutableCheckedIn::class]);
|
||||||
|
|
||||||
|
@ -72,14 +72,22 @@ class AssetCheckinTest extends TestCase
|
||||||
$this->assertEquals($status->id, $asset->status_id);
|
$this->assertEquals($status->id, $asset->status_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testAssetCheckedOutToAssetCanBeCheckedIn()
|
public function testCheckinTimeAndActionLogNoteCanBeSet()
|
||||||
{
|
{
|
||||||
$this->markTestIncomplete();
|
Event::fake();
|
||||||
}
|
|
||||||
|
|
||||||
public function testAssetCheckedOutToLocationCanBeCheckedIn()
|
$this->actingAs(User::factory()->checkinAssets()->create())
|
||||||
{
|
->post(route(
|
||||||
$this->markTestIncomplete();
|
'hardware.checkin.store',
|
||||||
|
['assetId' => Asset::factory()->assignedToUser()->create()->id]
|
||||||
|
), [
|
||||||
|
'checkin_at' => '2023-01-02 12:45:56',
|
||||||
|
'note' => 'hello'
|
||||||
|
]);
|
||||||
|
|
||||||
|
Event::assertDispatched(function (CheckoutableCheckedIn $event) {
|
||||||
|
return $event->action_date === '2023-01-02 12:45:56' && $event->note === 'hello';
|
||||||
|
}, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testLastCheckInFieldIsSetOnCheckin()
|
public function testLastCheckInFieldIsSetOnCheckin()
|
||||||
|
|
Loading…
Reference in a new issue