Files
crater/tests/Feature/DashboardTest.php
Mohit Panjwani bdf2ba51d6 init crater
2019-11-11 12:16:00 +05:30

48 lines
966 B
PHP

<?php
namespace Tests\Feature;
use Tests\TestCase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Laraspace\User;
use Laravel\Passport\Passport;
use SettingsSeeder;
class DashboardTest extends TestCase
{
use RefreshDatabase;
protected $user;
public function setUp(): void
{
parent::setUp();
$this->seed();
$this->seed(SettingsSeeder::class);
$user = User::find(1);
$this->withHeaders([
'company' => $user->company_id,
]);
Passport::actingAs(
$user,
['*']
);
}
/** @test */
public function testDashboard()
{
$response = $this->json('GET', 'api/dashboard');
$response->assertOk();
}
/** @test */
public function testPieChartData()
{
$response = $this->json('GET', 'api/dashboard/expense/chart');
$response->assertOk();
}
}