lantern

sprout-garden-phase-2-test

Test: Sprout Garden Phase 2

Following [[pattern-looking-glass-development]] - the tests ARE the documentation.

Subject

Phase 2 plot types: form imprinters, color imprinters (direct assignment)

config

path: null
plots_dir: /Users/graemefawcett/working/ben.fawcett.family/activities/sprout-garden/src/plots/types

Spec

Test: Form Imprinter Stamps Shape

describe('Form Imprinter', () => {
  it('circle imprinter always outputs circle', () => {
    const imprinter = createFormImprinter('circle');
    
    expect(imprinter.grow({ shape: 'star', color: 'red' }).shape).toBe('circle');
    expect(imprinter.grow({ shape: 'square', color: 'blue' }).shape).toBe('circle');
    expect(imprinter.grow({ shape: 'triangle', color: 'green' }).shape).toBe('circle');
  });
  
  it('preserves color when stamping shape', () => {
    const imprinter = createFormImprinter('star');
    const result = imprinter.grow({ shape: 'circle', color: 'blue' });
    
    expect(result.shape).toBe('star');
    expect(result.color).toBe('blue');
  });
  
  it('has pass-through fruits', () => {
    const imprinter = createFormImprinter('square');
    expect(imprinter.fruits).toContain('pass-through');
  });
});

Test: Color Imprinter Stamps Color

describe('Color Imprinter', () => {
  it('red imprinter always outputs red', () => {
    const imprinter = createColorImprinter('red');
    
    expect(imprinter.grow({ shape: 'circle', color: 'blue' }).color).toBe('red');
    expect(imprinter.grow({ shape: 'star', color: 'green' }).color).toBe('red');
    expect(imprinter.grow({ shape: 'square', color: 'yellow' }).color).toBe('red');
  });
  
  it('preserves shape when stamping color', () => {
    const imprinter = createColorImprinter('green');
    const result = imprinter.grow({ shape: 'triangle', color: 'red' });
    
    expect(result.color).toBe('green');
    expect(result.shape).toBe('triangle');
  });
  
  it('has pass-through fruits', () => {
    const imprinter = createColorImprinter('blue');
    expect(imprinter.fruits).toContain('pass-through');
  });
});

Test: Imprinter vs Grower

describe('Imprinter vs Grower', () => {
  it('grower increments, imprinter assigns', () => {
    const grower = formGrower;
    const imprinter = createFormImprinter('circle');
    
    const sprout = { shape: 'circle', color: 'red' };
    
    // Grower advances: circle → square
    expect(grower.grow(sprout).shape).toBe('square');
    
    // Imprinter stamps: anything → circle
    expect(imprinter.grow({ shape: 'star', color: 'red' }).shape).toBe('circle');
  });
  
  it('imprinter can reset after grower', () => {
    const grower = formGrower;
    const imprinter = createFormImprinter('circle');
    
    let sprout = { shape: 'circle', color: 'red' };
    
    // Grow twice: circle → square → triangle
    sprout = grower.grow(sprout);
    sprout = grower.grow(sprout);
    expect(sprout.shape).toBe('triangle');
    
    // Reset to circle
    sprout = imprinter.grow(sprout);
    expect(sprout.shape).toBe('circle');
  });
});

Results

{
  "summary": "0/2 tests passing",
  "phase": "Phase 2: Imprinting",
  "status": "not yet implemented",
  "tests": [
    {
      "test": "form-imprinter.js exists",
      "status": "fail",
      "details": "not yet implemented"
    },
    {
      "test": "color-imprinter.js exists",
      "status": "fail",
      "details": "not yet implemented"
    }
  ]
}

Provenance

Fences

test-form-imprinter

  • Status: Spec only (Phase 2 not implemented)
  • By: Claude (2025-11-29)
  • Note: Form imprinter specification

test-color-imprinter

  • Status: Spec only
  • By: Claude (2025-11-29)
  • Note: Color imprinter specification

test-imprinter-vs-grower

  • Status: Spec only
  • By: Claude (2025-11-29)
  • Note: Distinguishes assignment from transformation

sprout-garden-phase-2-results

  • Status: Verified (checks for implementation)
  • By: Claude (2025-11-29)
  • Note: Reports Phase 2 implementation status

Slots

North

slots:
- sprout-garden-phase-2

South

slots: []

East

slots: []

West

slots:
- pattern-looking-glass-development