mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-01-14 15:37:53 +00:00
This commit is contained in:
parent
c67a182cf2
commit
b4b6286172
89 changed files with 672 additions and 666 deletions
|
|
@ -9,7 +9,7 @@ use Livewire\Livewire;
|
|||
|
||||
uses(RefreshDatabase::class);
|
||||
|
||||
test('device auto join component can be rendered', function () {
|
||||
test('device auto join component can be rendered', function (): void {
|
||||
$user = User::factory()->create(['assign_new_devices' => false]);
|
||||
|
||||
Livewire::actingAs($user)
|
||||
|
|
@ -19,7 +19,7 @@ test('device auto join component can be rendered', function () {
|
|||
->assertSet('isFirstUser', true);
|
||||
});
|
||||
|
||||
test('device auto join component initializes with user settings', function () {
|
||||
test('device auto join component initializes with user settings', function (): void {
|
||||
$user = User::factory()->create(['assign_new_devices' => true]);
|
||||
|
||||
Livewire::actingAs($user)
|
||||
|
|
@ -28,7 +28,7 @@ test('device auto join component initializes with user settings', function () {
|
|||
->assertSet('isFirstUser', true);
|
||||
});
|
||||
|
||||
test('device auto join component identifies first user correctly', function () {
|
||||
test('device auto join component identifies first user correctly', function (): void {
|
||||
$firstUser = User::factory()->create(['id' => 1, 'assign_new_devices' => false]);
|
||||
$otherUser = User::factory()->create(['id' => 2, 'assign_new_devices' => false]);
|
||||
|
||||
|
|
@ -41,7 +41,7 @@ test('device auto join component identifies first user correctly', function () {
|
|||
->assertSet('isFirstUser', false);
|
||||
});
|
||||
|
||||
test('device auto join component updates user setting when toggled', function () {
|
||||
test('device auto join component updates user setting when toggled', function (): void {
|
||||
$user = User::factory()->create(['assign_new_devices' => false]);
|
||||
|
||||
Livewire::actingAs($user)
|
||||
|
|
@ -55,7 +55,7 @@ test('device auto join component updates user setting when toggled', function ()
|
|||
|
||||
// Validation test removed - Livewire automatically handles boolean conversion
|
||||
|
||||
test('device auto join component handles false value correctly', function () {
|
||||
test('device auto join component handles false value correctly', function (): void {
|
||||
$user = User::factory()->create(['assign_new_devices' => true]);
|
||||
|
||||
Livewire::actingAs($user)
|
||||
|
|
@ -67,7 +67,7 @@ test('device auto join component handles false value correctly', function () {
|
|||
expect($user->assign_new_devices)->toBeFalse();
|
||||
});
|
||||
|
||||
test('device auto join component only updates when deviceAutojoin property changes', function () {
|
||||
test('device auto join component only updates when deviceAutojoin property changes', function (): void {
|
||||
$user = User::factory()->create(['assign_new_devices' => false]);
|
||||
|
||||
$component = Livewire::actingAs($user)
|
||||
|
|
@ -80,7 +80,7 @@ test('device auto join component only updates when deviceAutojoin property chang
|
|||
expect($user->assign_new_devices)->toBeFalse();
|
||||
});
|
||||
|
||||
test('device auto join component renders correct view', function () {
|
||||
test('device auto join component renders correct view', function (): void {
|
||||
$user = User::factory()->create();
|
||||
|
||||
Livewire::actingAs($user)
|
||||
|
|
@ -88,7 +88,7 @@ test('device auto join component renders correct view', function () {
|
|||
->assertViewIs('livewire.actions.device-auto-join');
|
||||
});
|
||||
|
||||
test('device auto join component works with authenticated user', function () {
|
||||
test('device auto join component works with authenticated user', function (): void {
|
||||
$user = User::factory()->create(['assign_new_devices' => true]);
|
||||
|
||||
$component = Livewire::actingAs($user)
|
||||
|
|
@ -98,7 +98,7 @@ test('device auto join component works with authenticated user', function () {
|
|||
expect($component->instance()->isFirstUser)->toBe($user->id === 1);
|
||||
});
|
||||
|
||||
test('device auto join component handles multiple updates correctly', function () {
|
||||
test('device auto join component handles multiple updates correctly', function (): void {
|
||||
$user = User::factory()->create(['assign_new_devices' => false]);
|
||||
|
||||
$component = Livewire::actingAs($user)
|
||||
|
|
|
|||
|
|
@ -6,11 +6,11 @@ use Illuminate\Support\Facades\Http;
|
|||
use Livewire\Volt\Volt;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
|
||||
beforeEach(function () {
|
||||
beforeEach(function (): void {
|
||||
Cache::flush();
|
||||
});
|
||||
|
||||
it('can render catalog component', function () {
|
||||
it('can render catalog component', function (): void {
|
||||
// Mock empty catalog response
|
||||
Http::fake([
|
||||
config('app.catalog_url') => Http::response('', 200),
|
||||
|
|
@ -21,7 +21,7 @@ it('can render catalog component', function () {
|
|||
$component->assertSee('No plugins available');
|
||||
});
|
||||
|
||||
it('loads plugins from catalog URL', function () {
|
||||
it('loads plugins from catalog URL', function (): void {
|
||||
// Clear cache first to ensure fresh data
|
||||
Cache::forget('catalog_plugins');
|
||||
|
||||
|
|
@ -62,7 +62,7 @@ it('loads plugins from catalog URL', function () {
|
|||
$component->assertSee('MIT');
|
||||
});
|
||||
|
||||
it('shows error when plugin not found', function () {
|
||||
it('shows error when plugin not found', function (): void {
|
||||
$user = User::factory()->create();
|
||||
|
||||
$this->actingAs($user);
|
||||
|
|
@ -75,7 +75,7 @@ it('shows error when plugin not found', function () {
|
|||
$component->assertHasErrors();
|
||||
});
|
||||
|
||||
it('shows error when zip_url is missing', function () {
|
||||
it('shows error when zip_url is missing', function (): void {
|
||||
$user = User::factory()->create();
|
||||
|
||||
// Mock the HTTP response for the catalog URL without zip_url
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue