Skip to content

Commit eadd170

Browse files
Fix tests
1 parent ecadd93 commit eadd170

File tree

1 file changed

+38
-24
lines changed

1 file changed

+38
-24
lines changed

test.js

Lines changed: 38 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -89,34 +89,40 @@ test('regular mode', async () => {
8989

9090
expect(fetch).toHaveBeenCalledTimes(3);
9191

92-
expect(fetch).toHaveBeenNthCalledWith(1,
93-
'https://sak.userreport.com/publisherId/media/mediaId/ios.json');
92+
expect(fetch).toHaveBeenNthCalledWith(
93+
1,
94+
'https://sak.userreport.com/publisherId/media/mediaId/ios.json',
95+
);
9496

95-
expect(fetch).toHaveBeenNthCalledWith(2,
97+
expect(fetch).toHaveBeenNthCalledWith(
98+
2,
9699
'https://visitanalytics.userreport.com/hit.gif'
97100
+ '?t=__FetchMediaCode__'
98-
+ '&r=4fzzzxjylrx'
101+
+ '&rnd=4fzzzxjylrx'
99102
+ '&d=__NativeAdvertisingId__'
100103
+ '&idfv=__DeviceInfoUniqueId__'
101-
+ '&med=__DeviceInfoBundleId__'
104+
+ '&appid=__DeviceInfoBundleId__'
102105
+ '&os=__DeviceInfoSystemName__'
103106
+ '&osv=__DeviceInfoSystemVersion__'
104107
+ '&dn=__DeviceInfoBrand__%20__DeviceInfoDeviceId__'
105108
+ '&dr=150x300'
106-
+ '&gdpr_consent=__FetchConsent__');
109+
+ '&gdpr_consent=__FetchConsent__',
110+
);
107111

108-
expect(fetch).toHaveBeenNthCalledWith(3,
112+
expect(fetch).toHaveBeenNthCalledWith(
113+
3,
109114
'https://visitanalytics.userreport.com/hit.gif'
110115
+ '?t=__FetchSectionCode__'
111-
+ '&r=4fzzzxjylrx'
116+
+ '&rnd=4fzzzxjylrx'
112117
+ '&d=__NativeAdvertisingId__'
113118
+ '&idfv=__DeviceInfoUniqueId__'
114-
+ '&med=__DeviceInfoBundleId__'
119+
+ '&appid=__DeviceInfoBundleId__'
115120
+ '&os=__DeviceInfoSystemName__'
116121
+ '&osv=__DeviceInfoSystemVersion__'
117122
+ '&dn=__DeviceInfoBrand__%20__DeviceInfoDeviceId__'
118123
+ '&dr=150x300'
119-
+ '&gdpr_consent=__FetchConsent__');
124+
+ '&gdpr_consent=__FetchConsent__',
125+
);
120126
});
121127

122128
test('legacy idfa', async () => {
@@ -127,18 +133,20 @@ test('legacy idfa', async () => {
127133
UserReport.trackScreenView(),
128134
]);
129135

130-
expect(fetch).toHaveBeenNthCalledWith(2,
136+
expect(fetch).toHaveBeenNthCalledWith(
137+
2,
131138
'https://visitanalytics.userreport.com/hit.gif'
132139
+ '?t=__FetchMediaCode__'
133-
+ '&r=4fzzzxjylrx'
140+
+ '&rnd=4fzzzxjylrx'
134141
+ '&d=__NativeAdvertisingLegacyId__'
135142
+ '&idfv=__DeviceInfoUniqueId__'
136-
+ '&med=__DeviceInfoBundleId__'
143+
+ '&appid=__DeviceInfoBundleId__'
137144
+ '&os=__DeviceInfoSystemName__'
138145
+ '&osv=__DeviceInfoSystemVersion__'
139146
+ '&dn=__DeviceInfoBrand__%20__DeviceInfoDeviceId__'
140147
+ '&dr=150x300'
141-
+ '&gdpr_consent=__FetchConsent__');
148+
+ '&gdpr_consent=__FetchConsent__',
149+
);
142150
});
143151

144152
test('dnt mode', async () => {
@@ -154,28 +162,34 @@ test('dnt mode', async () => {
154162

155163
expect(fetch).toHaveBeenCalledTimes(3);
156164

157-
expect(fetch).toHaveBeenNthCalledWith(1,
158-
'https://sak.dnt-userreport.com/publisherId/media/mediaId/android.json');
165+
expect(fetch).toHaveBeenNthCalledWith(
166+
1,
167+
'https://sak.dnt-userreport.com/publisherId/media/mediaId/android.json',
168+
);
159169

160-
expect(fetch).toHaveBeenNthCalledWith(2,
170+
expect(fetch).toHaveBeenNthCalledWith(
171+
2,
161172
'https://visitanalytics.dnt-userreport.com/hit.gif'
162173
+ '?t=__FetchMediaCode__'
163-
+ '&r=4fzzzxjylrx'
164-
+ '&med=__DeviceInfoBundleId__'
174+
+ '&rnd=4fzzzxjylrx'
175+
+ '&appid=__DeviceInfoBundleId__'
165176
+ '&os=__DeviceInfoSystemName__'
166177
+ '&osv=__DeviceInfoSystemVersion__'
167178
+ '&dn=__DeviceInfoBrand__%20__DeviceInfoDeviceId__'
168179
+ '&dr=150x300'
169-
+ '&gdpr_consent=__FetchConsent__');
180+
+ '&gdpr_consent=__FetchConsent__',
181+
);
170182

171-
expect(fetch).toHaveBeenNthCalledWith(3,
183+
expect(fetch).toHaveBeenNthCalledWith(
184+
3,
172185
'https://visitanalytics.dnt-userreport.com/hit.gif'
173186
+ '?t=__FetchSectionCode__'
174-
+ '&r=4fzzzxjylrx'
175-
+ '&med=__DeviceInfoBundleId__'
187+
+ '&rnd=4fzzzxjylrx'
188+
+ '&appid=__DeviceInfoBundleId__'
176189
+ '&os=__DeviceInfoSystemName__'
177190
+ '&osv=__DeviceInfoSystemVersion__'
178191
+ '&dn=__DeviceInfoBrand__%20__DeviceInfoDeviceId__'
179192
+ '&dr=150x300'
180-
+ '&gdpr_consent=__FetchConsent__');
193+
+ '&gdpr_consent=__FetchConsent__',
194+
);
181195
});

0 commit comments

Comments
 (0)