@@ -50,6 +50,7 @@ jest.mock('react-native-device-info', () => ({
50
50
51
51
getBrand : ( ) => '__DeviceInfoBrand__' ,
52
52
getDeviceId : ( ) => '__DeviceInfoDeviceId__' ,
53
+ getVersion : ( ) => '__VersionNumber__' ,
53
54
} ,
54
55
} ) , { virtual : true } ) ;
55
56
@@ -89,34 +90,42 @@ test('regular mode', async () => {
89
90
90
91
expect ( fetch ) . toHaveBeenCalledTimes ( 3 ) ;
91
92
92
- expect ( fetch ) . toHaveBeenNthCalledWith ( 1 ,
93
- 'https://sak.userreport.com/publisherId/media/mediaId/ios.json' ) ;
93
+ expect ( fetch ) . toHaveBeenNthCalledWith (
94
+ 1 ,
95
+ 'https://sak.userreport.com/publisherId/media/mediaId/ios.json' ,
96
+ ) ;
94
97
95
- expect ( fetch ) . toHaveBeenNthCalledWith ( 2 ,
98
+ expect ( fetch ) . toHaveBeenNthCalledWith (
99
+ 2 ,
96
100
'https://visitanalytics.userreport.com/hit.gif'
97
101
+ '?t=__FetchMediaCode__'
98
- + '&r =4fzzzxjylrx'
102
+ + '&rnd =4fzzzxjylrx'
99
103
+ '&d=__NativeAdvertisingId__'
100
104
+ '&idfv=__DeviceInfoUniqueId__'
101
- + '&med=__DeviceInfoBundleId__'
105
+ + '&appid=__DeviceInfoBundleId__'
106
+ + '&appver=__VersionNumber__'
102
107
+ '&os=__DeviceInfoSystemName__'
103
108
+ '&osv=__DeviceInfoSystemVersion__'
104
109
+ '&dn=__DeviceInfoBrand__%20__DeviceInfoDeviceId__'
105
110
+ '&dr=150x300'
106
- + '&gdpr_consent=__FetchConsent__' ) ;
111
+ + '&gdpr_consent=__FetchConsent__' ,
112
+ ) ;
107
113
108
- expect ( fetch ) . toHaveBeenNthCalledWith ( 3 ,
114
+ expect ( fetch ) . toHaveBeenNthCalledWith (
115
+ 3 ,
109
116
'https://visitanalytics.userreport.com/hit.gif'
110
117
+ '?t=__FetchSectionCode__'
111
- + '&r =4fzzzxjylrx'
118
+ + '&rnd =4fzzzxjylrx'
112
119
+ '&d=__NativeAdvertisingId__'
113
120
+ '&idfv=__DeviceInfoUniqueId__'
114
- + '&med=__DeviceInfoBundleId__'
121
+ + '&appid=__DeviceInfoBundleId__'
122
+ + '&appver=__VersionNumber__'
115
123
+ '&os=__DeviceInfoSystemName__'
116
124
+ '&osv=__DeviceInfoSystemVersion__'
117
125
+ '&dn=__DeviceInfoBrand__%20__DeviceInfoDeviceId__'
118
126
+ '&dr=150x300'
119
- + '&gdpr_consent=__FetchConsent__' ) ;
127
+ + '&gdpr_consent=__FetchConsent__' ,
128
+ ) ;
120
129
} ) ;
121
130
122
131
test ( 'legacy idfa' , async ( ) => {
@@ -127,18 +136,21 @@ test('legacy idfa', async () => {
127
136
UserReport . trackScreenView ( ) ,
128
137
] ) ;
129
138
130
- expect ( fetch ) . toHaveBeenNthCalledWith ( 2 ,
139
+ expect ( fetch ) . toHaveBeenNthCalledWith (
140
+ 2 ,
131
141
'https://visitanalytics.userreport.com/hit.gif'
132
142
+ '?t=__FetchMediaCode__'
133
- + '&r =4fzzzxjylrx'
143
+ + '&rnd =4fzzzxjylrx'
134
144
+ '&d=__NativeAdvertisingLegacyId__'
135
145
+ '&idfv=__DeviceInfoUniqueId__'
136
- + '&med=__DeviceInfoBundleId__'
146
+ + '&appid=__DeviceInfoBundleId__'
147
+ + '&appver=__VersionNumber__'
137
148
+ '&os=__DeviceInfoSystemName__'
138
149
+ '&osv=__DeviceInfoSystemVersion__'
139
150
+ '&dn=__DeviceInfoBrand__%20__DeviceInfoDeviceId__'
140
151
+ '&dr=150x300'
141
- + '&gdpr_consent=__FetchConsent__' ) ;
152
+ + '&gdpr_consent=__FetchConsent__' ,
153
+ ) ;
142
154
} ) ;
143
155
144
156
test ( 'dnt mode' , async ( ) => {
@@ -154,28 +166,36 @@ test('dnt mode', async () => {
154
166
155
167
expect ( fetch ) . toHaveBeenCalledTimes ( 3 ) ;
156
168
157
- expect ( fetch ) . toHaveBeenNthCalledWith ( 1 ,
158
- 'https://sak.dnt-userreport.com/publisherId/media/mediaId/android.json' ) ;
169
+ expect ( fetch ) . toHaveBeenNthCalledWith (
170
+ 1 ,
171
+ 'https://sak.dnt-userreport.com/publisherId/media/mediaId/android.json' ,
172
+ ) ;
159
173
160
- expect ( fetch ) . toHaveBeenNthCalledWith ( 2 ,
174
+ expect ( fetch ) . toHaveBeenNthCalledWith (
175
+ 2 ,
161
176
'https://visitanalytics.dnt-userreport.com/hit.gif'
162
177
+ '?t=__FetchMediaCode__'
163
- + '&r=4fzzzxjylrx'
164
- + '&med=__DeviceInfoBundleId__'
178
+ + '&rnd=4fzzzxjylrx'
179
+ + '&appid=__DeviceInfoBundleId__'
180
+ + '&appver=__VersionNumber__'
165
181
+ '&os=__DeviceInfoSystemName__'
166
182
+ '&osv=__DeviceInfoSystemVersion__'
167
183
+ '&dn=__DeviceInfoBrand__%20__DeviceInfoDeviceId__'
168
184
+ '&dr=150x300'
169
- + '&gdpr_consent=__FetchConsent__' ) ;
185
+ + '&gdpr_consent=__FetchConsent__' ,
186
+ ) ;
170
187
171
- expect ( fetch ) . toHaveBeenNthCalledWith ( 3 ,
188
+ expect ( fetch ) . toHaveBeenNthCalledWith (
189
+ 3 ,
172
190
'https://visitanalytics.dnt-userreport.com/hit.gif'
173
191
+ '?t=__FetchSectionCode__'
174
- + '&r=4fzzzxjylrx'
175
- + '&med=__DeviceInfoBundleId__'
192
+ + '&rnd=4fzzzxjylrx'
193
+ + '&appid=__DeviceInfoBundleId__'
194
+ + '&appver=__VersionNumber__'
176
195
+ '&os=__DeviceInfoSystemName__'
177
196
+ '&osv=__DeviceInfoSystemVersion__'
178
197
+ '&dn=__DeviceInfoBrand__%20__DeviceInfoDeviceId__'
179
198
+ '&dr=150x300'
180
- + '&gdpr_consent=__FetchConsent__' ) ;
199
+ + '&gdpr_consent=__FetchConsent__' ,
200
+ ) ;
181
201
} ) ;
0 commit comments