mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-01-13 15:07:49 +00:00
chore: stricter pint rules
This commit is contained in:
parent
16b2e8436e
commit
e535496a1e
30 changed files with 134 additions and 83 deletions
|
|
@ -8,7 +8,7 @@ use App\Models\User;
|
|||
use Illuminate\Support\Facades\Storage;
|
||||
use Laravel\Sanctum\Sanctum;
|
||||
|
||||
uses(\Illuminate\Foundation\Testing\RefreshDatabase::class);
|
||||
uses(Illuminate\Foundation\Testing\RefreshDatabase::class);
|
||||
|
||||
beforeEach(function () {
|
||||
Storage::fake('public');
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
use App\Models\Device;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
uses(\Illuminate\Foundation\Testing\RefreshDatabase::class);
|
||||
uses(Illuminate\Foundation\Testing\RefreshDatabase::class);
|
||||
|
||||
beforeEach(function () {
|
||||
Storage::fake('public');
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
use App\Models\User;
|
||||
use Livewire\Volt\Volt as LivewireVolt;
|
||||
|
||||
uses(\Illuminate\Foundation\Testing\RefreshDatabase::class);
|
||||
uses(Illuminate\Foundation\Testing\RefreshDatabase::class);
|
||||
|
||||
test('login screen can be rendered', function () {
|
||||
$response = $this->get('/login');
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ use Illuminate\Auth\Events\Verified;
|
|||
use Illuminate\Support\Facades\Event;
|
||||
use Illuminate\Support\Facades\URL;
|
||||
|
||||
uses(\Illuminate\Foundation\Testing\RefreshDatabase::class);
|
||||
uses(Illuminate\Foundation\Testing\RefreshDatabase::class);
|
||||
|
||||
test('email verification screen can be rendered', function () {
|
||||
$user = User::factory()->unverified()->create();
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
use App\Models\User;
|
||||
use Livewire\Volt\Volt;
|
||||
|
||||
uses(\Illuminate\Foundation\Testing\RefreshDatabase::class);
|
||||
uses(Illuminate\Foundation\Testing\RefreshDatabase::class);
|
||||
|
||||
test('confirm password screen can be rendered', function () {
|
||||
$user = User::factory()->create();
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ use Illuminate\Auth\Notifications\ResetPassword;
|
|||
use Illuminate\Support\Facades\Notification;
|
||||
use Livewire\Volt\Volt;
|
||||
|
||||
uses(\Illuminate\Foundation\Testing\RefreshDatabase::class);
|
||||
uses(Illuminate\Foundation\Testing\RefreshDatabase::class);
|
||||
|
||||
test('reset password link screen can be rendered', function () {
|
||||
$response = $this->get('/forgot-password');
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
use Livewire\Volt\Volt;
|
||||
|
||||
uses(\Illuminate\Foundation\Testing\RefreshDatabase::class);
|
||||
uses(Illuminate\Foundation\Testing\RefreshDatabase::class);
|
||||
|
||||
test('registration screen can be rendered', function () {
|
||||
$response = $this->get('/register');
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
use App\Models\User;
|
||||
|
||||
uses(\Illuminate\Foundation\Testing\RefreshDatabase::class);
|
||||
uses(Illuminate\Foundation\Testing\RefreshDatabase::class);
|
||||
|
||||
test('guests are redirected to the login page', function () {
|
||||
$response = $this->get('/dashboard');
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
use App\Models\Device;
|
||||
|
||||
uses(\Illuminate\Foundation\Testing\RefreshDatabase::class);
|
||||
uses(Illuminate\Foundation\Testing\RefreshDatabase::class);
|
||||
|
||||
test('device can be created with basic attributes', function () {
|
||||
$device = Device::factory()->create([
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ use App\Models\Device;
|
|||
use App\Models\User;
|
||||
use Livewire\Volt\Volt;
|
||||
|
||||
uses(\Illuminate\Foundation\Testing\RefreshDatabase::class);
|
||||
uses(Illuminate\Foundation\Testing\RefreshDatabase::class);
|
||||
|
||||
test('device management page can be rendered', function () {
|
||||
$user = User::factory()->create();
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ use App\Models\Device;
|
|||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
uses(\Illuminate\Foundation\Testing\RefreshDatabase::class);
|
||||
uses(Illuminate\Foundation\Testing\RefreshDatabase::class);
|
||||
|
||||
beforeEach(function () {
|
||||
Storage::fake('public');
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ use App\Jobs\GenerateScreenJob;
|
|||
use App\Models\Device;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
uses(\Illuminate\Foundation\Testing\RefreshDatabase::class);
|
||||
uses(Illuminate\Foundation\Testing\RefreshDatabase::class);
|
||||
|
||||
beforeEach(function () {
|
||||
Storage::fake('public');
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ test('it keeps only the 50 most recent logs per device', function () {
|
|||
$device2 = Device::factory()->create();
|
||||
|
||||
// Create 60 logs for each device with different timestamps
|
||||
for ($i = 0; $i < 60; $i++) {
|
||||
for ($i = 0; $i < 60; ++$i) {
|
||||
DeviceLog::factory()->create([
|
||||
'device_id' => $device1->id,
|
||||
'device_timestamp' => now()->subMinutes($i),
|
||||
|
|
@ -37,7 +37,7 @@ test('it keeps only the 50 most recent logs per device', function () {
|
|||
$device2Logs = $device2->logs()->orderByDesc('device_timestamp')->get();
|
||||
|
||||
// Check that the timestamps are in descending order
|
||||
for ($i = 0; $i < 49; $i++) {
|
||||
for ($i = 0; $i < 49; ++$i) {
|
||||
expect($device1Logs[$i]->device_timestamp->gt($device1Logs[$i + 1]->device_timestamp))->toBeTrue()
|
||||
->and($device2Logs[$i]->device_timestamp->gt($device2Logs[$i + 1]->device_timestamp))->toBeTrue();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ use App\Models\User;
|
|||
use Illuminate\Support\Facades\Hash;
|
||||
use Livewire\Volt\Volt;
|
||||
|
||||
uses(\Illuminate\Foundation\Testing\RefreshDatabase::class);
|
||||
uses(Illuminate\Foundation\Testing\RefreshDatabase::class);
|
||||
|
||||
test('password can be updated', function () {
|
||||
$user = User::factory()->create([
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
use App\Models\User;
|
||||
use Livewire\Volt\Volt;
|
||||
|
||||
uses(\Illuminate\Foundation\Testing\RefreshDatabase::class);
|
||||
uses(Illuminate\Foundation\Testing\RefreshDatabase::class);
|
||||
|
||||
test('profile page is displayed', function () {
|
||||
$this->actingAs($user = User::factory()->create());
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ test('device log casts device_timestamp to datetime', function () {
|
|||
'device_timestamp' => $timestamp,
|
||||
]);
|
||||
|
||||
expect($log->device_timestamp)->toBeInstanceOf(\Carbon\Carbon::class)
|
||||
expect($log->device_timestamp)->toBeInstanceOf(Carbon\Carbon::class)
|
||||
->and($log->device_timestamp->timestamp)->toBe($timestamp->timestamp);
|
||||
});
|
||||
|
||||
|
|
@ -45,7 +45,7 @@ test('device log factory creates valid data', function () {
|
|||
$log = DeviceLog::factory()->create();
|
||||
|
||||
expect($log->device_id)->toBeInt()
|
||||
->and($log->device_timestamp)->toBeInstanceOf(\Carbon\Carbon::class)
|
||||
->and($log->device_timestamp)->toBeInstanceOf(Carbon\Carbon::class)
|
||||
->and($log->log_entry)->toBeArray()
|
||||
->and($log->log_entry)->toHaveKeys(['creation_timestamp', 'device_status_stamp', 'log_id', 'log_message', 'log_codeline', 'log_sourcefile', 'additional_info']);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
use App\Models\Plugin;
|
||||
|
||||
uses(\Illuminate\Foundation\Testing\RefreshDatabase::class);
|
||||
uses(Illuminate\Foundation\Testing\RefreshDatabase::class);
|
||||
|
||||
test('plugin has required attributes', function () {
|
||||
$plugin = Plugin::factory()->create([
|
||||
|
|
@ -26,7 +26,7 @@ test('plugin automatically generates uuid on creation', function () {
|
|||
});
|
||||
|
||||
test('plugin can have custom uuid', function () {
|
||||
$uuid = \Illuminate\Support\Str::uuid();
|
||||
$uuid = Illuminate\Support\Str::uuid();
|
||||
$plugin = Plugin::factory()->create(['uuid' => $uuid]);
|
||||
|
||||
expect($plugin->uuid)->toBe($uuid);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue