Update SignIn tests for registration-gated SSO buttons.
Deploy Beta / unit-tests (push) Successful in 11s
Unit Tests / test (push) Successful in 12s
Deploy Beta / deploy-beta (push) Successful in 2m23s

This commit is contained in:
2026-08-05 09:02:58 -05:00
parent 508f11b558
commit 1a434b208e
+18 -3
View File
@@ -79,10 +79,10 @@ describe('SignIn', () => {
expect(await screen.findByRole('button', { name: /Don't have an account\? Sign up/i })).toBeInTheDocument();
});
it('shows SSO buttons when oauth providers configured', async () => {
it('shows SSO buttons when registration enabled and oauth providers configured', async () => {
mockGet.mockResolvedValue({
data: {
enable_account_registration: false,
enable_account_registration: true,
oauth: { google: true, microsoft: true },
},
});
@@ -92,10 +92,25 @@ describe('SignIn', () => {
expect(screen.getByRole('button', { name: 'Sign in with Microsoft' })).toBeInTheDocument();
});
it('hides SSO buttons when oauth not configured', async () => {
it('hides SSO buttons when registration disabled even if oauth configured', async () => {
mockGet.mockResolvedValue({
data: {
enable_account_registration: false,
oauth: { google: true, microsoft: true },
},
});
renderSignIn();
await waitFor(() => {
expect(screen.queryByRole('button', { name: 'Continue with Google' })).not.toBeInTheDocument();
expect(screen.queryByRole('button', { name: 'Sign in with Microsoft' })).not.toBeInTheDocument();
});
});
it('hides SSO buttons when oauth not configured', async () => {
mockGet.mockResolvedValue({
data: {
enable_account_registration: true,
oauth: { google: false, microsoft: false },
},
});