fix(env-vars): treat search wildcards literally

Escape SQL LIKE wildcard characters in environment variable searches and hide production or preview sections when the filtered results are empty.
This commit is contained in:
Andras Bacsai
2026-06-03 13:43:26 +02:00
parent d7524a743d
commit 1802522c60
4 changed files with 127 additions and 29 deletions
@@ -45,3 +45,12 @@ it('renders a single no results message for empty environment variable searches'
->toContain('<div>No environment variables found.</div>')
->toContain('@else');
});
it('only renders the production section when production variables are visible', function () {
$view = file_get_contents(resource_path('views/livewire/project/shared/environment-variable/all.blade.php'));
expect($view)
->toContain('@if ($this->environmentVariables->isNotEmpty() || $this->hardcodedEnvironmentVariables->isNotEmpty())')
->not->toContain('@forelse ($this->environmentVariables as $env)')
->not->toContain('@empty');
});