KnowledgeGraphPagesTest.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. namespace Tests\Feature;
  3. use App\Models\User;
  4. use Tests\TestCase;
  5. class KnowledgeGraphPagesTest extends TestCase
  6. {
  7. public function test_knowledge_graph_management_page_loads()
  8. {
  9. // Assuming authentication is required, we might need to act as a user.
  10. // If Filament uses a specific guard or user model, adjust accordingly.
  11. // For now, let's try accessing it. If it redirects to login, we'll know.
  12. // Filament usually requires a user with specific permissions.
  13. // Let's assume a basic user for now or check if we can mock the auth.
  14. // Since I don't have the full auth context, I'll try to hit the page.
  15. // If it's protected, it should redirect (302) or return 401/403.
  16. // A 500 error is what we want to avoid.
  17. $response = $this->get('/admin/knowledge-graph-management');
  18. // If it redirects to login, that's "success" in terms of "no 500 error".
  19. if ($response->status() === 302) {
  20. $response->assertStatus(302);
  21. } else {
  22. $response->assertStatus(200);
  23. }
  24. }
  25. public function test_knowledge_relation_management_page_loads()
  26. {
  27. $response = $this->get('/admin/knowledge-relation-management');
  28. if ($response->status() === 302) {
  29. $response->assertStatus(302);
  30. } else {
  31. $response->assertStatus(200);
  32. }
  33. }
  34. }