working companion prototype

This commit is contained in:
2025-11-24 23:32:36 +01:00
parent e7978024d7
commit e2bea9a126
175 changed files with 23227 additions and 3519 deletions

View File

@@ -8,21 +8,21 @@ describe('StepId Value Object', () => {
expect(stepId.value).toBe(1);
});
it('should create a valid StepId for step 18', () => {
const stepId = StepId.create(18);
expect(stepId.value).toBe(18);
it('should create a valid StepId for step 17', () => {
const stepId = StepId.create(17);
expect(stepId.value).toBe(17);
});
it('should throw error for step 0 (below minimum)', () => {
expect(() => StepId.create(0)).toThrow('StepId must be between 1 and 18');
expect(() => StepId.create(0)).toThrow('StepId must be between 1 and 17');
});
it('should throw error for step 19 (above maximum)', () => {
expect(() => StepId.create(19)).toThrow('StepId must be between 1 and 18');
it('should throw error for step 18 (above maximum)', () => {
expect(() => StepId.create(18)).toThrow('StepId must be between 1 and 17');
});
it('should throw error for negative step', () => {
expect(() => StepId.create(-1)).toThrow('StepId must be between 1 and 18');
expect(() => StepId.create(-1)).toThrow('StepId must be between 1 and 17');
});
it('should throw error for non-integer step', () => {
@@ -67,13 +67,13 @@ describe('StepId Value Object', () => {
});
describe('isFinalStep', () => {
it('should return true for step 18', () => {
const stepId = StepId.create(18);
it('should return true for step 17', () => {
const stepId = StepId.create(17);
expect(stepId.isFinalStep()).toBe(true);
});
it('should return false for step 17', () => {
const stepId = StepId.create(17);
it('should return false for step 16', () => {
const stepId = StepId.create(16);
expect(stepId.isFinalStep()).toBe(false);
});
@@ -90,14 +90,14 @@ describe('StepId Value Object', () => {
expect(nextStep.value).toBe(2);
});
it('should return next step for step 17', () => {
const stepId = StepId.create(17);
it('should return next step for step 16', () => {
const stepId = StepId.create(16);
const nextStep = stepId.next();
expect(nextStep.value).toBe(18);
expect(nextStep.value).toBe(17);
});
it('should throw error when calling next on step 18', () => {
const stepId = StepId.create(18);
it('should throw error when calling next on step 17', () => {
const stepId = StepId.create(17);
expect(() => stepId.next()).toThrow('Cannot advance beyond final step');
});
});