veza/apps/web/src/features/auth/components/EmailVerificationBadge.test.tsx
senke 670282989b chore(refactor/sumi-migration): commit pending changes — tests, stream server, dist_verification
- apps/web: test updates (Vitest/setup), playbackAnalyticsService, TrackGrid, serviceErrorHandler
- veza-common: logging, metrics, traits, validation, random
- veza-stream-server: audio pipeline, codecs, cache, monitoring, routes
- apps/web/dist_verification: refresh build assets (content-hashed filenames)

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-13 19:39:18 +01:00

35 lines
1.3 KiB
TypeScript

import { describe, it, expect } from 'vitest';
import { render, screen } from '@/test/helpers';
import { EmailVerificationBadge } from './EmailVerificationBadge';
describe('EmailVerificationBadge', () => {
it('should display verified badge when email is verified', () => {
render(<EmailVerificationBadge verified={true} />);
expect(screen.getByText(/email verified/i)).toBeInTheDocument();
expect(screen.getByText(/✓/i)).toBeInTheDocument();
});
it('should display not verified badge when email is not verified', () => {
render(<EmailVerificationBadge verified={false} />);
expect(screen.getByText(/email not verified/i)).toBeInTheDocument();
expect(screen.getByText(/⚠/i)).toBeInTheDocument();
});
it('should have correct styling for verified badge', () => {
const { container } = render(<EmailVerificationBadge verified={true} />);
const badge = container.querySelector('span');
expect(badge?.className).toContain('bg-success/20');
expect(badge?.className).toContain('text-success');
});
it('should have correct styling for not verified badge', () => {
const { container } = render(<EmailVerificationBadge verified={false} />);
const badge = container.querySelector('span');
expect(badge?.className).toContain('bg-warning/20');
expect(badge?.className).toContain('text-warning');
});
});