File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ import { Wizard } from '../../../shared/wizards/wizard'
10
10
import { WizardForm } from '../../../shared/wizards/wizardForm'
11
11
12
12
interface MockWizardFormElement < TProp > {
13
+ readonly value : TProp | undefined
14
+
13
15
applyInput ( input : TProp ) : void
14
16
clearInput ( ) : void
15
17
/**
@@ -37,6 +39,7 @@ type MockForm<T, TState = T> = {
37
39
}
38
40
39
41
type FormTesterMethodKey = keyof MockWizardFormElement < any >
42
+ const VALUE : FormTesterMethodKey = 'value'
40
43
const APPLY_INPUT : FormTesterMethodKey = 'applyInput'
41
44
const CLEAR_INPUT : FormTesterMethodKey = 'clearInput'
42
45
const ASSERT_SHOW : FormTesterMethodKey = 'assertShow'
@@ -124,6 +127,8 @@ export function createWizardTester<T extends Partial<T>>(wizard: Wizard<T> | Wiz
124
127
125
128
// Using a switch rather than a map since a generic index signature is not yet possible
126
129
switch ( prop ) {
130
+ case VALUE :
131
+ return _ . get ( form . applyDefaults ( state ) , path )
127
132
case APPLY_INPUT :
128
133
return < TProp > ( input : TProp ) => _ . set ( state , path , input )
129
134
case CLEAR_INPUT :
You can’t perform that action at this time.
0 commit comments