Files
gridpilot.gg/apps/website/lib/formatters/DriverRegistrationStatusFormatter.test.tsx
Marc Mintel 3db2209d2a
Some checks failed
CI / lint-typecheck (push) Failing after 4m52s
CI / tests (push) Has been skipped
CI / contract-tests (push) Has been skipped
CI / e2e-tests (push) Has been skipped
CI / comment-pr (push) Has been skipped
CI / commit-types (push) Has been skipped
formatter tests
2026-01-25 11:17:47 +01:00

35 lines
1.3 KiB
TypeScript

import { describe, it, expect } from 'vitest';
import { DriverRegistrationStatusFormatter } from './DriverRegistrationStatusFormatter';
describe('DriverRegistrationStatusFormatter', () => {
describe('statusMessage', () => {
it('should return "Registered for this race" when registered', () => {
expect(DriverRegistrationStatusFormatter.statusMessage(true)).toBe('Registered for this race');
});
it('should return "Not registered" when not registered', () => {
expect(DriverRegistrationStatusFormatter.statusMessage(false)).toBe('Not registered');
});
});
describe('statusBadgeVariant', () => {
it('should return "success" when registered', () => {
expect(DriverRegistrationStatusFormatter.statusBadgeVariant(true)).toBe('success');
});
it('should return "warning" when not registered', () => {
expect(DriverRegistrationStatusFormatter.statusBadgeVariant(false)).toBe('warning');
});
});
describe('registrationButtonText', () => {
it('should return "Withdraw" when registered', () => {
expect(DriverRegistrationStatusFormatter.registrationButtonText(true)).toBe('Withdraw');
});
it('should return "Register" when not registered', () => {
expect(DriverRegistrationStatusFormatter.registrationButtonText(false)).toBe('Register');
});
});
});