@@ -27,10 +27,12 @@ let contextSentToGetter = false
27
27
let contextSentToSetter = false
28
28
let contextSentToSubscriber = false
29
29
let contextSentToEvent = false
30
+ let bothContextSentToEvent = false
30
31
31
32
beforeAll ( ( ) => {
32
33
33
34
transport . onSend ( json => {
35
+ console . dir ( json )
34
36
if ( json . method === 'advanced.propertyWithContext' ) {
35
37
if ( json . params . appId === 'some-app' ) {
36
38
contextSentToGetter = true
@@ -68,6 +70,11 @@ beforeAll( () => {
68
70
contextSentToEvent = true
69
71
}
70
72
}
73
+ else if ( json . method === "advanced.onEventWithTwoContext" ) {
74
+ if ( json . params . appId === 'some-app' && json . params . state === 'inactive' ) {
75
+ bothContextSentToEvent = true
76
+ }
77
+ }
71
78
} )
72
79
73
80
Advanced . propertyWithContext ( 'some-app' , true )
@@ -97,8 +104,14 @@ test('Context Property set', () => {
97
104
expect ( contextSentToSetter ) . toBe ( true )
98
105
} ) ;
99
106
100
- test ( 'Event with context' , ( ) => {
107
+ test ( 'Event with single context param ' , ( ) => {
101
108
Advanced . listen ( "eventWithContext" , "some-app" , ( data ) => {
102
109
expect ( contextSentToEvent ) . toBe ( true )
103
110
} )
111
+ } )
112
+
113
+ test ( 'Event with two context params' , ( ) => {
114
+ Advanced . listen ( "eventWithTwoContext" , "some-app" , "inactive" , ( data ) => {
115
+ expect ( bothContextSentToEvent ) . toBe ( true )
116
+ } )
104
117
} )
0 commit comments