@@ -27,7 +27,7 @@ describe("Test that getComponentStateValue()", () => {
2727 it ( "works on 1st level" , ( ) => {
2828 expect (
2929 getComponentStateValue ( componentState , {
30- type : "Input " ,
30+ link : "component " ,
3131 id : "b1" ,
3232 property : "value" ,
3333 } ) ,
@@ -37,7 +37,7 @@ describe("Test that getComponentStateValue()", () => {
3737 it ( "works on 2nd level" , ( ) => {
3838 expect (
3939 getComponentStateValue ( componentState , {
40- type : "Input " ,
40+ link : "component " ,
4141 id : "p1" ,
4242 property : "chart" ,
4343 } ) ,
@@ -47,15 +47,15 @@ describe("Test that getComponentStateValue()", () => {
4747 it ( "works on 3rd level" , ( ) => {
4848 expect (
4949 getComponentStateValue ( componentState , {
50- type : "Input " ,
50+ link : "component " ,
5151 id : "cb1" ,
5252 property : "value" ,
5353 } ) ,
5454 ) . toEqual ( true ) ;
5555
5656 expect (
5757 getComponentStateValue ( componentState , {
58- type : "Input " ,
58+ link : "component " ,
5959 id : "dd1" ,
6060 property : "value" ,
6161 } ) ,
@@ -67,21 +67,27 @@ describe("Test that getInputValueFromState()", () => {
6767 it ( "works with input.id and input.property" , ( ) => {
6868 const state = { x : { y : 26 } } ;
6969 expect (
70- getInputValueFromState ( { type : "State" , id : "x" , property : "y" } , state ) ,
70+ getInputValueFromState (
71+ { link : "component" , id : "x" , property : "y" } ,
72+ state ,
73+ ) ,
7174 ) . toEqual ( 26 ) ;
7275 } ) ;
7376
7477 it ( "works with arrays indexes" , ( ) => {
7578 const state = { x : [ 4 , 5 , 6 ] } ;
7679 expect (
77- getInputValueFromState ( { type : "State" , id : "x" , property : "1" } , state ) ,
80+ getInputValueFromState (
81+ { link : "component" , id : "x" , property : "1" } ,
82+ state ,
83+ ) ,
7884 ) . toEqual ( 5 ) ;
7985 } ) ;
8086
8187 it ( "works without input.id" , ( ) => {
8288 const state = { x : [ 4 , 5 , 6 ] } ;
8389 expect (
84- getInputValueFromState ( { type : "State " , property : "x" } , state ) ,
90+ getInputValueFromState ( { link : "container " , property : "x" } , state ) ,
8591 ) . toEqual ( [ 4 , 5 , 6 ] ) ;
8692 } ) ;
8793} ) ;
0 commit comments