feat: add UserResource with is_admin toggle and delete
User management resource with editable is_admin field, postcode support, admin filter, and inline delete action. Includes list and edit pages. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,7 +4,7 @@ use App\Models\Station;
|
||||
use App\Services\StationTaggingService;
|
||||
|
||||
beforeEach(function (): void {
|
||||
$this->service = new StationTaggingService();
|
||||
$this->service = new StationTaggingService;
|
||||
});
|
||||
|
||||
it('marks tesco station as supermarket and normalises brand', function (): void {
|
||||
@@ -54,10 +54,23 @@ it('handles case insensitive matching', function (): void {
|
||||
->and($station->brand_name)->toBe('Morrisons');
|
||||
});
|
||||
|
||||
it('marks station as supermarket when brand_name matches even if trading_name does not', function (): void {
|
||||
$station = new Station([
|
||||
'trading_name' => 'PETERBOROUGH EXTRA - PETROL FILLING STATION',
|
||||
'brand_name' => 'TESCO',
|
||||
'is_supermarket' => false,
|
||||
]);
|
||||
|
||||
$this->service->tag($station);
|
||||
|
||||
expect($station->is_supermarket)->toBeTrue()
|
||||
->and($station->brand_name)->toBe('Tesco');
|
||||
});
|
||||
|
||||
it('does not overwrite brand_name for non-supermarket stations', function (): void {
|
||||
$station = new Station([
|
||||
'trading_name' => 'Shell Garage',
|
||||
'brand_name' => 'Shell',
|
||||
'trading_name' => 'Shell Garage',
|
||||
'brand_name' => 'Shell',
|
||||
'is_supermarket' => false,
|
||||
]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user