set('form.email', $email) ->set('form.password', 'wrong'.$i) ->call('login'); } $component = Volt::test('pages.auth.login') ->set('form.email', $email) ->set('form.password', 'wrong6') ->call('login'); $component->assertHasErrors(['form.email']); $errors = $component->errors(); expect($errors->has('form.email'))->toBeTrue(); $errorMsg = $errors->first('form.email'); // Accept either the translated string or the raw key (translation may not load in test env) expect( str_contains($errorMsg, 'Too many login attempts') || $errorMsg === 'auth.throttle' )->toBeTrue("Expected throttle error, got: {$errorMsg}"); });