Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbyiliev committed Dec 1, 2024
1 parent 2a76f9e commit 0828339
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions config/devdojo/auth/language.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
'already_have_an_account' => 'Already have an account?',
'sign_in' => 'Sign in',
'button' => 'Continue',
'email_registration_disabled' => 'Email registration is currently disabled. Please use social login.',
],
'verify' => [
'page_title' => 'Verify Your Account',
Expand Down
2 changes: 1 addition & 1 deletion resources/views/pages/auth/register.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function register()
if (!$this->settings->enable_email_registration) {
session()->flash('error', config('devdojo.auth.language.register.email_registration_disabled', 'Email registration is currently disabled. Please use social login.'));
return;
return redirect()->route('auth.register');
}
if (!$this->showPasswordField) {
Expand Down
7 changes: 6 additions & 1 deletion tests/Feature/RegistrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@
it('preserves social login functionality when email registration is disabled', function () {
config()->set('devdojo.auth.settings.enable_email_registration', false);

config()->set('devdojo.auth.providers', [
'google' => ['name' => 'Google', 'active' => true],
'facebook' => ['name' => 'Facebook', 'active' => false],
]);

Livewire::test('auth.register')
->assertSee('social-providers');
->assertSee('Google');
});

0 comments on commit 0828339

Please sign in to comment.