mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-14 16:52:45 -04:00
- Delete Blade components, component classes, Livewire components and views that nothing uses after the redesign. - Delete tests that only compare Blade/CSS source text; keep the source checks for authorization gates, stable wire:key values and escaping. - Update stale tests to the current UI and behaviour. - Update DESIGN.md to the current navigation and layout. - Add a lesson: test behaviour, not source markup. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
29 lines
1.3 KiB
PHP
29 lines
1.3 KiB
PHP
<?php
|
|
|
|
use App\Livewire\Project\Service\DatabaseBackups;
|
|
|
|
it('declares the database backup mount return type', function () {
|
|
$returnType = (new ReflectionMethod(DatabaseBackups::class, 'mount'))->getReturnType();
|
|
|
|
expect($returnType)->not->toBeNull()
|
|
->and($returnType->getName())->toBe('mixed');
|
|
});
|
|
|
|
it('refreshes backup executions from backup broadcasts on the current team channel', function () {
|
|
$serviceExecutions = file_get_contents(app_path('Livewire/Project/Service/BackupExecutions.php'));
|
|
$serviceBackups = file_get_contents(app_path('Livewire/Project/Service/VolumeBackup/Index.php'));
|
|
$databaseExecutions = file_get_contents(app_path('Livewire/Project/Database/BackupExecutions.php'));
|
|
$databaseBackupJob = file_get_contents(app_path('Jobs/DatabaseBackupJob.php'));
|
|
|
|
expect($serviceExecutions)
|
|
->toContain('echo-private:team.{$teamId},BackupCreated')
|
|
->toContain("=> '\$refresh'")
|
|
->and($serviceBackups)
|
|
->toContain('echo-private:team.{$teamId},BackupCreated')
|
|
->and($databaseExecutions)
|
|
->toContain('$teamId = currentTeam()->id')
|
|
->not->toContain('$userId = Auth::id()')
|
|
->and(strpos($databaseBackupJob, "'finished_at' => Carbon::now()->toImmutable()"))
|
|
->toBeLessThan(strrpos($databaseBackupJob, 'BackupCreated::dispatch($this->team->id)'));
|
|
});
|