35 lines
1.0 KiB
TypeScript
35 lines
1.0 KiB
TypeScript
import { describe, it, expect } from 'vitest';
|
|
import { CompleteOnboardingViewModel } from './CompleteOnboardingViewModel';
|
|
import type { CompleteOnboardingOutputDTO } from '../types/generated/CompleteOnboardingOutputDTO';
|
|
|
|
describe('CompleteOnboardingViewModel', () => {
|
|
it('should create instance with success flag', () => {
|
|
const dto: CompleteOnboardingOutputDTO = {
|
|
success: true,
|
|
};
|
|
|
|
const viewModel = new CompleteOnboardingViewModel(dto);
|
|
|
|
expect(viewModel.success).toBe(true);
|
|
});
|
|
|
|
it('should expose isSuccessful as true when success is true', () => {
|
|
const dto: CompleteOnboardingOutputDTO = {
|
|
success: true,
|
|
};
|
|
|
|
const viewModel = new CompleteOnboardingViewModel(dto);
|
|
|
|
expect(viewModel.isSuccessful).toBe(true);
|
|
});
|
|
|
|
it('should expose isSuccessful as false when success is false', () => {
|
|
const dto: CompleteOnboardingOutputDTO = {
|
|
success: false,
|
|
};
|
|
|
|
const viewModel = new CompleteOnboardingViewModel(dto);
|
|
|
|
expect(viewModel.isSuccessful).toBe(false);
|
|
});
|
|
}); |