mirror of
				https://github.com/crater-invoice/crater.git
				synced 2025-10-31 05:31:10 -04:00 
			
		
		
		
	init crater
This commit is contained in:
		
							
								
								
									
										47
									
								
								tests/Feature/DashboardTest.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								tests/Feature/DashboardTest.php
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,47 @@ | ||||
| <?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(); | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user