49 lines
1.9 KiB
TypeScript
49 lines
1.9 KiB
TypeScript
import { describe, it, expect } from 'vitest';
|
|
import { OnboardingStatusFormatter } from './OnboardingStatusFormatter';
|
|
|
|
describe('OnboardingStatusFormatter', () => {
|
|
describe('statusLabel', () => {
|
|
it('should return "Onboarding Complete" when success is true', () => {
|
|
expect(OnboardingStatusFormatter.statusLabel(true)).toBe('Onboarding Complete');
|
|
});
|
|
|
|
it('should return "Onboarding Failed" when success is false', () => {
|
|
expect(OnboardingStatusFormatter.statusLabel(false)).toBe('Onboarding Failed');
|
|
});
|
|
});
|
|
|
|
describe('statusVariant', () => {
|
|
it('should return "performance-green" when success is true', () => {
|
|
expect(OnboardingStatusFormatter.statusVariant(true)).toBe('performance-green');
|
|
});
|
|
|
|
it('should return "racing-red" when success is false', () => {
|
|
expect(OnboardingStatusFormatter.statusVariant(false)).toBe('racing-red');
|
|
});
|
|
});
|
|
|
|
describe('statusIcon', () => {
|
|
it('should return "✅" when success is true', () => {
|
|
expect(OnboardingStatusFormatter.statusIcon(true)).toBe('✅');
|
|
});
|
|
|
|
it('should return "❌" when success is false', () => {
|
|
expect(OnboardingStatusFormatter.statusIcon(false)).toBe('❌');
|
|
});
|
|
});
|
|
|
|
describe('statusMessage', () => {
|
|
it('should return success message when success is true', () => {
|
|
expect(OnboardingStatusFormatter.statusMessage(true)).toBe('Your onboarding has been completed successfully.');
|
|
});
|
|
|
|
it('should return default failure message when success is false and no error message', () => {
|
|
expect(OnboardingStatusFormatter.statusMessage(false)).toBe('Failed to complete onboarding. Please try again.');
|
|
});
|
|
|
|
it('should return custom error message when success is false and error message provided', () => {
|
|
expect(OnboardingStatusFormatter.statusMessage(false, 'Custom error')).toBe('Custom error');
|
|
});
|
|
});
|
|
});
|