mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Add test case for saving custom reports
This commit is contained in:
parent
89c47c1879
commit
c68a2a36fa
|
@ -38,7 +38,23 @@ class SavedReportsTest extends TestCase
|
|||
|
||||
public function testCanSaveACustomReport()
|
||||
{
|
||||
$this->markTestIncomplete();
|
||||
$user = User::factory()->canViewReports()->create();
|
||||
|
||||
$this->actingAs($user)
|
||||
->post(route('savedreports/store'), [
|
||||
'name' => 'My Awesome Report',
|
||||
'company' => '1',
|
||||
'by_company_id' => ['1', '2'],
|
||||
])
|
||||
->assertRedirect();
|
||||
|
||||
$report = $user->savedReports->first(function ($report) {
|
||||
return $report->name === 'My Awesome Report';
|
||||
});
|
||||
|
||||
$this->assertNotNull($report);
|
||||
$this->assertEquals('1', $report->options['company']);
|
||||
$this->assertEquals(['1', '2'], $report->options['by_company_id']);
|
||||
}
|
||||
|
||||
public function testSavingReportRequiresValidFields()
|
||||
|
|
Loading…
Reference in a new issue