operator('Owner')->create(); } it('warns instead of silently ignoring a purchase without a customer', function () { Livewire::actingAs(operatorUser())->test(Billing::class) ->call('purchase', 'storage') ->assertDispatched('notify'); expect(Order::query()->count())->toBe(0); }); it('warns instead of silently ignoring a profile save without a customer', function () { Livewire::actingAs(operatorUser())->test(Settings::class) ->set('companyName', 'Nope GmbH') ->call('saveProfile') ->assertDispatched('notify'); }); it('warns instead of silently ignoring a seat invite without a customer', function () { Livewire::actingAs(operatorUser())->test(Users::class) ->set('inviteEmail', 'x@no-customer.test') ->call('invite') ->assertDispatched('notify'); expect(\App\Models\Seat::query()->count())->toBe(0); }); it('shows an error in the cancel-package modal without a customer', function () { Livewire::actingAs(operatorUser())->test(ConfirmCancelPackage::class) ->set('confirmName', 'whatever') ->call('cancelPackage') ->assertHasErrors(['confirmName']); }); it('shows an error in the close-account modal without a customer', function () { Livewire::actingAs(operatorUser())->test(ConfirmCloseAccount::class) ->set('confirmWord', __('settings.close_keyword')) ->call('closeAccount') ->assertHasErrors(['confirmWord']); }); it('renders the portal notice for an operator account', function () { $this->actingAs(operatorUser())->get(route('dashboard')) ->assertOk() ->assertSee(__('dashboard.no_customer_title')); });