mirror of
https://github.com/coollabsio/coolify.git
synced 2026-10-29 01:54:37 +08: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>
16 lines
770 B
PHP
16 lines
770 B
PHP
<?php
|
|
|
|
it('authorizes secret-enabled environment variable inputs at the component boundary', function () {
|
|
$addView = file_get_contents(resource_path('views/livewire/project/shared/environment-variable/add.blade.php'));
|
|
$showView = file_get_contents(resource_path('views/livewire/project/shared/environment-variable/show.blade.php'));
|
|
|
|
// Show resolves the resource through its computed `resource` property.
|
|
foreach ([[$addView, '$resource'], [$showView, '$this->resource']] as [$view, $resourceExpression]) {
|
|
preg_match('/<x-forms\.env-var-input[\s\S]*?\/>/', $view, $matches);
|
|
|
|
expect($matches[0] ?? '')
|
|
->toContain('canGate="manageEnvironment"')
|
|
->toContain(':canResource="'.$resourceExpression.'"');
|
|
}
|
|
});
|