mirror of
https://github.com/henrywhitaker3/Speedtest-Tracker.git
synced 2025-12-31 01:57:20 +01:00
Added unit tests
This commit is contained in:
41
tests/Feature/ConfigTest.php
Normal file
41
tests/Feature/ConfigTest.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Tests\TestCase;
|
||||
|
||||
class ConfigTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
private $configStructure = [
|
||||
'base',
|
||||
'graphs' => [
|
||||
'download_upload_graph_enabled' => [],
|
||||
'download_upload_graph_width' => [],
|
||||
'ping_graph_enabled' => [],
|
||||
'ping_graph_width' => [],
|
||||
'failure_graph_enabled' => [],
|
||||
'failure_graph_width' => [],
|
||||
],
|
||||
'editable' => [
|
||||
'slack_webhook',
|
||||
'telegram_bot_token',
|
||||
'telegram_chat_id'
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* Test config returned by API
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testAPIConfig()
|
||||
{
|
||||
$response = $this->get('api/settings/config');
|
||||
|
||||
$response->assertJsonStructure($this->configStructure);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user