File tree Expand file tree Collapse file tree 1 file changed +69
-0
lines changed Expand file tree Collapse file tree 1 file changed +69
-0
lines changed Original file line number Diff line number Diff line change @@ -220,6 +220,75 @@ describe('PushWorker', () => {
220
220
}
221
221
} ) ;
222
222
} ) ;
223
+
224
+ it ( 'should propely override alert-lang with translations' , ( ) => {
225
+ const bodies = PushUtils . bodiesPerLocales ( {
226
+ data : {
227
+ alert : 'Yo!' ,
228
+ badge : 'Increment' ,
229
+ 'alert-fr' : 'Yolo!' ,
230
+ } ,
231
+ translation : {
232
+ 'fr' : { alert : 'frenchy!' , title : 'yolo' } ,
233
+ 'en' : { alert : 'english' , badge : 2 , other : 'value' } ,
234
+ }
235
+ } , [ 'fr' , 'en' ] ) ;
236
+ expect ( bodies ) . toEqual ( {
237
+ fr : {
238
+ data : {
239
+ alert : 'frenchy!' ,
240
+ title : 'yolo' ,
241
+ }
242
+ } ,
243
+ en : {
244
+ data : {
245
+ alert : 'english' ,
246
+ badge : 2 ,
247
+ other : 'value'
248
+ }
249
+ } ,
250
+ default : {
251
+ data : {
252
+ alert : 'Yo!' ,
253
+ badge : 'Increment' ,
254
+ }
255
+ }
256
+ } ) ;
257
+ } ) ;
258
+
259
+ it ( 'should propely override alert-lang with translations strings' , ( ) => {
260
+ const bodies = PushUtils . bodiesPerLocales ( {
261
+ data : {
262
+ alert : 'Yo!' ,
263
+ badge : 'Increment' ,
264
+ 'alert-fr' : 'Yolo!' ,
265
+ 'alert-en' : 'Yolo!'
266
+ } ,
267
+ translation : {
268
+ 'fr' : 'frenchy' ,
269
+ }
270
+ } , [ 'fr' , 'en' ] ) ;
271
+ expect ( bodies ) . toEqual ( {
272
+ fr : {
273
+ data : {
274
+ alert : 'frenchy' ,
275
+ badge : 'Increment' ,
276
+ }
277
+ } ,
278
+ en : {
279
+ data : {
280
+ alert : 'Yolo!' ,
281
+ badge : 'Increment'
282
+ }
283
+ } ,
284
+ default : {
285
+ data : {
286
+ alert : 'Yo!' ,
287
+ badge : 'Increment' ,
288
+ }
289
+ }
290
+ } ) ;
291
+ } ) ;
223
292
} ) ;
224
293
225
294
describe ( 'pushStatus' , ( ) => {
You can’t perform that action at this time.
0 commit comments