- {branding?.logo ? (
+ {brandingLogo ? (
- {typeof branding.logo === 'string' ? (
-

+ {typeof brandingLogo === 'string' ? (
+

) : (
- branding.logo
+ brandingLogo
)}
) : (
diff --git a/sdks/urbackend-react/tests/UrAuth.test.tsx b/sdks/urbackend-react/tests/UrAuth.test.tsx
index 8613008f6..3f3a1f715 100644
--- a/sdks/urbackend-react/tests/UrAuth.test.tsx
+++ b/sdks/urbackend-react/tests/UrAuth.test.tsx
@@ -94,6 +94,12 @@ describe('UrAuth Component', () => {
expect(primaryButton.style.background).toContain('#4F46E5');
});
+ it('applies custom primary color from colors.primaryColor', () => {
+ render(
);
+ const primaryButton = screen.getByRole('button', { name: 'Log In' });
+ expect(primaryButton.style.background).toContain('#6366f1');
+ });
+
it('hides email/password form when disabled via providers object', () => {
render(
);
expect(screen.queryByPlaceholderText('Enter your email address')).not.toBeInTheDocument();
@@ -103,14 +109,14 @@ describe('UrAuth Component', () => {
});
it('only shows GitHub login when configured via providers object', () => {
- render(
);
+ render(
);
expect(screen.queryByPlaceholderText('Enter your email address')).not.toBeInTheDocument();
expect(screen.getByText('Continue with GitHub')).toBeInTheDocument();
expect(screen.queryByText('Continue with Google')).not.toBeInTheDocument();
});
it('displays message when all authentication methods are disabled', () => {
- render(
);
+ render(
);
expect(screen.getByText('No authentication methods are enabled for this screen.')).toBeInTheDocument();
});
@@ -130,4 +136,13 @@ describe('UrAuth Component', () => {
expect(logoImg).toBeInTheDocument();
expect(logoImg?.getAttribute('src')).toBe('/assets/logo.png');
});
+
+ it('supports logoUrl branding alias', () => {
+ render(
+
+ );
+ const logoImg = screen.getByRole('img', { name: 'My Custom App' });
+ expect(logoImg).toBeInTheDocument();
+ expect(logoImg.getAttribute('src')).toBe('/assets/logo-url.png');
+ });
});