import React from 'react'; import { WizardParentStep, WizardSubStep } from '../types'; import { buildSteps } from '../utils'; import { WizardStep } from '../WizardStep'; describe('buildSteps', () => { test('throws error if child is not of type WizardStep', () => { try { buildSteps(
); } catch (error) { expect(error.message).toEqual('Wizard only accepts children of type WizardStep.'); } }); test('throws error if no children are valid react elements', () => { try { buildSteps('test' as any); } catch (error) { expect(error.message).toEqual('Wizard only accepts children of type WizardStep.'); } }); test('returns array of steps if children are of type WizardStep', () => { const component =