adrema/tests/Feature/Settings/GlobalSettingTest.php

37 lines
914 B
PHP
Raw Normal View History

<?php
namespace Tests\Feature\Settings;
use App\Setting\GeneralSettings;
2022-02-12 01:08:56 +01:00
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Tests\TestCase;
class GlobalSettingTest extends TestCase
{
2022-02-12 01:08:56 +01:00
use DatabaseTransactions;
public function testItLoadsGeneralSettings(): void
{
GeneralSettings::fake([
2021-11-23 01:02:18 +01:00
'modules' => ['bill'],
]);
$this->withoutExceptionHandling();
$this->login()->init();
$response = $this->get('/setting');
2022-03-11 20:19:17 +01:00
2022-02-12 00:41:52 +01:00
$this->assertComponent('setting/Index', $response);
$this->assertEquals(['bill'], $this->inertia($response, 'general.modules'));
}
public function testItGetsOptionsForModels(): void
{
$this->withoutExceptionHandling();
$this->login()->init();
$response = $this->get('/setting');
2022-03-11 20:19:17 +01:00
2022-02-12 00:41:52 +01:00
$this->assertContains('bill', $this->inertia($response, 'options.modules'));
}
}