@@ -31,11 +31,16 @@ class MockTemplateRowService implements Partial<TemplateRowService> {
31
31
mock_row_1 : { value : "" , _nested_name : "mock_row_1" , name : "mock_row_1" , type : "" } ,
32
32
mock_row_2 : { value : "" , _nested_name : "mock_row_2" , name : "mock_row_2" , type : "" } ,
33
33
} ;
34
+ templateRowMapValues = {
35
+ mock_row_1 : "" ,
36
+ mock_row_2 : "" ,
37
+ } ;
34
38
processRowUpdates = async ( ) => null ;
35
39
}
36
40
37
41
class MockContainer implements Partial < TemplateContainerComponent > {
38
42
templateRowService = new MockTemplateRowService ( ) as any as TemplateRowService ;
43
+
39
44
get templateRowMap ( ) {
40
45
return this . templateRowService . templateRowMap ;
41
46
}
@@ -74,14 +79,16 @@ describe("TemplateActionService", () => {
74
79
await service . handleActions ( [
75
80
{ trigger : "click" , action_id : "set_local" , args : [ "mock_row_1" , "updated" ] } ,
76
81
] ) ;
77
- expect ( service . container . templateRowMap . mock_row_1 . value ) . toEqual ( "updated" ) ;
82
+ expect ( service . container . templateRowService . templateRowMap . mock_row_1 . value ) . toEqual ( "updated" ) ;
83
+ expect ( service . container . templateRowService . templateRowMapValues . mock_row_1 ) . toEqual ( "updated" ) ;
78
84
} ) ;
79
85
80
86
it ( "set_self action" , async ( ) => {
81
87
await service . handleActions ( [
82
88
{ trigger : "click" , action_id : "set_self" , args : [ "mock_row_1" , "updated" ] } ,
83
89
] ) ;
84
- expect ( service . container . templateRowMap . mock_row_1 . value ) . toEqual ( "updated" ) ;
90
+ expect ( service . container . templateRowService . templateRowMap . mock_row_1 . value ) . toEqual ( "updated" ) ;
91
+ expect ( service . container . templateRowService . templateRowMapValues . mock_row_1 ) . toEqual ( "updated" ) ;
85
92
} ) ;
86
93
87
94
it ( "Uses latest value for `this.value` arg" , async ( ) => {
@@ -97,7 +104,8 @@ describe("TemplateActionService", () => {
97
104
] ,
98
105
_triggeredBy
99
106
) ;
100
- expect ( service . container . templateRowMap . mock_row_2 . value ) . toEqual ( "updated" ) ;
107
+ expect ( service . container . templateRowService . templateRowMap . mock_row_2 . value ) . toEqual ( "updated" ) ;
108
+ expect ( service . container . templateRowService . templateRowMapValues . mock_row_2 ) . toEqual ( "updated" ) ;
101
109
// also include test case of concatenated expression
102
110
await service . handleActions (
103
111
[
@@ -109,7 +117,9 @@ describe("TemplateActionService", () => {
109
117
] ,
110
118
_triggeredBy
111
119
) ;
112
- expect ( service . container . templateRowMap . mock_row_2 . value ) . toEqual ( "prefix_updated" ) ;
120
+ expect ( service . container . templateRowService . templateRowMap . mock_row_2 . value ) . toEqual (
121
+ "prefix_updated"
122
+ ) ;
113
123
} ) ;
114
124
115
125
it ( "Uses latest value for `this.value` param" , async ( ) => {
0 commit comments