@@ -140,6 +140,7 @@ describe('gl_emoji', () => {
140
140
} ,
141
141
) ;
142
142
} ) ;
143
+
143
144
it ( 'bomb emoji with sprite fallback' , ( ) => {
144
145
const emojiKey = 'bomb' ;
145
146
const markup = glEmojiTag ( emojiFixtureMap [ emojiKey ] . name , {
@@ -195,24 +196,31 @@ describe('gl_emoji', () => {
195
196
it ( 'should gracefully handle empty string' , ( ) => {
196
197
expect ( isFlagEmoji ( '' ) ) . toBeFalsy ( ) ;
197
198
} ) ;
199
+
198
200
it ( 'should detect flag_ac' , ( ) => {
199
201
expect ( isFlagEmoji ( '🇦🇨' ) ) . toBeTruthy ( ) ;
200
202
} ) ;
203
+
201
204
it ( 'should detect flag_us' , ( ) => {
202
205
expect ( isFlagEmoji ( '🇺🇸' ) ) . toBeTruthy ( ) ;
203
206
} ) ;
207
+
204
208
it ( 'should detect flag_zw' , ( ) => {
205
209
expect ( isFlagEmoji ( '🇿🇼' ) ) . toBeTruthy ( ) ;
206
210
} ) ;
211
+
207
212
it ( 'should not detect flags' , ( ) => {
208
213
expect ( isFlagEmoji ( '🎏' ) ) . toBeFalsy ( ) ;
209
214
} ) ;
215
+
210
216
it ( 'should not detect triangular_flag_on_post' , ( ) => {
211
217
expect ( isFlagEmoji ( '🚩' ) ) . toBeFalsy ( ) ;
212
218
} ) ;
219
+
213
220
it ( 'should not detect single letter' , ( ) => {
214
221
expect ( isFlagEmoji ( '🇦' ) ) . toBeFalsy ( ) ;
215
222
} ) ;
223
+
216
224
it ( 'should not detect >2 letters' , ( ) => {
217
225
expect ( isFlagEmoji ( '🇦🇧🇨' ) ) . toBeFalsy ( ) ;
218
226
} ) ;
@@ -222,15 +230,19 @@ describe('gl_emoji', () => {
222
230
it ( 'should gracefully handle empty string' , ( ) => {
223
231
expect ( isRainbowFlagEmoji ( '' ) ) . toBeFalsy ( ) ;
224
232
} ) ;
233
+
225
234
it ( 'should detect rainbow_flag' , ( ) => {
226
235
expect ( isRainbowFlagEmoji ( '🏳🌈' ) ) . toBeTruthy ( ) ;
227
236
} ) ;
237
+
228
238
it ( 'should not detect flag_white on its\' own' , ( ) => {
229
239
expect ( isRainbowFlagEmoji ( '🏳' ) ) . toBeFalsy ( ) ;
230
240
} ) ;
241
+
231
242
it ( 'should not detect rainbow on its\' own' , ( ) => {
232
243
expect ( isRainbowFlagEmoji ( '🌈' ) ) . toBeFalsy ( ) ;
233
244
} ) ;
245
+
234
246
it ( 'should not detect flag_white with something else' , ( ) => {
235
247
expect ( isRainbowFlagEmoji ( '🏳🔵' ) ) . toBeFalsy ( ) ;
236
248
} ) ;
@@ -240,15 +252,19 @@ describe('gl_emoji', () => {
240
252
it ( 'should gracefully handle empty string' , ( ) => {
241
253
expect ( isKeycapEmoji ( '' ) ) . toBeFalsy ( ) ;
242
254
} ) ;
255
+
243
256
it ( 'should detect one(keycap)' , ( ) => {
244
257
expect ( isKeycapEmoji ( '1️⃣' ) ) . toBeTruthy ( ) ;
245
258
} ) ;
259
+
246
260
it ( 'should detect nine(keycap)' , ( ) => {
247
261
expect ( isKeycapEmoji ( '9️⃣' ) ) . toBeTruthy ( ) ;
248
262
} ) ;
263
+
249
264
it ( 'should not detect ten(keycap)' , ( ) => {
250
265
expect ( isKeycapEmoji ( '🔟' ) ) . toBeFalsy ( ) ;
251
266
} ) ;
267
+
252
268
it ( 'should not detect hash(keycap)' , ( ) => {
253
269
expect ( isKeycapEmoji ( '#⃣' ) ) . toBeFalsy ( ) ;
254
270
} ) ;
@@ -258,24 +274,31 @@ describe('gl_emoji', () => {
258
274
it ( 'should gracefully handle empty string' , ( ) => {
259
275
expect ( isSkinToneComboEmoji ( '' ) ) . toBeFalsy ( ) ;
260
276
} ) ;
277
+
261
278
it ( 'should detect hand_splayed_tone5' , ( ) => {
262
279
expect ( isSkinToneComboEmoji ( '🖐🏿' ) ) . toBeTruthy ( ) ;
263
280
} ) ;
281
+
264
282
it ( 'should not detect hand_splayed' , ( ) => {
265
283
expect ( isSkinToneComboEmoji ( '🖐' ) ) . toBeFalsy ( ) ;
266
284
} ) ;
285
+
267
286
it ( 'should detect lifter_tone1' , ( ) => {
268
287
expect ( isSkinToneComboEmoji ( '🏋🏻' ) ) . toBeTruthy ( ) ;
269
288
} ) ;
289
+
270
290
it ( 'should not detect lifter' , ( ) => {
271
291
expect ( isSkinToneComboEmoji ( '🏋' ) ) . toBeFalsy ( ) ;
272
292
} ) ;
293
+
273
294
it ( 'should detect rowboat_tone4' , ( ) => {
274
295
expect ( isSkinToneComboEmoji ( '🚣🏾' ) ) . toBeTruthy ( ) ;
275
296
} ) ;
297
+
276
298
it ( 'should not detect rowboat' , ( ) => {
277
299
expect ( isSkinToneComboEmoji ( '🚣' ) ) . toBeFalsy ( ) ;
278
300
} ) ;
301
+
279
302
it ( 'should not detect individual tone emoji' , ( ) => {
280
303
expect ( isSkinToneComboEmoji ( '🏻' ) ) . toBeFalsy ( ) ;
281
304
} ) ;
@@ -285,9 +308,11 @@ describe('gl_emoji', () => {
285
308
it ( 'should gracefully handle empty string' , ( ) => {
286
309
expect ( isHorceRacingSkinToneComboEmoji ( '' ) ) . toBeFalsy ( ) ;
287
310
} ) ;
311
+
288
312
it ( 'should detect horse_racing_tone2' , ( ) => {
289
313
expect ( isHorceRacingSkinToneComboEmoji ( '🏇🏼' ) ) . toBeTruthy ( ) ;
290
314
} ) ;
315
+
291
316
it ( 'should not detect horse_racing' , ( ) => {
292
317
expect ( isHorceRacingSkinToneComboEmoji ( '🏇' ) ) . toBeFalsy ( ) ;
293
318
} ) ;
@@ -297,36 +322,47 @@ describe('gl_emoji', () => {
297
322
it ( 'should gracefully handle empty string' , ( ) => {
298
323
expect ( isPersonZwjEmoji ( '' ) ) . toBeFalsy ( ) ;
299
324
} ) ;
325
+
300
326
it ( 'should detect couple_mm' , ( ) => {
301
327
expect ( isPersonZwjEmoji ( '👨❤️👨' ) ) . toBeTruthy ( ) ;
302
328
} ) ;
329
+
303
330
it ( 'should not detect couple_with_heart' , ( ) => {
304
331
expect ( isPersonZwjEmoji ( '💑' ) ) . toBeFalsy ( ) ;
305
332
} ) ;
333
+
306
334
it ( 'should not detect couplekiss' , ( ) => {
307
335
expect ( isPersonZwjEmoji ( '💏' ) ) . toBeFalsy ( ) ;
308
336
} ) ;
337
+
309
338
it ( 'should detect family_mmb' , ( ) => {
310
339
expect ( isPersonZwjEmoji ( '👨👨👦' ) ) . toBeTruthy ( ) ;
311
340
} ) ;
341
+
312
342
it ( 'should detect family_mwgb' , ( ) => {
313
343
expect ( isPersonZwjEmoji ( '👨👩👧👦' ) ) . toBeTruthy ( ) ;
314
344
} ) ;
345
+
315
346
it ( 'should not detect family' , ( ) => {
316
347
expect ( isPersonZwjEmoji ( '👪' ) ) . toBeFalsy ( ) ;
317
348
} ) ;
349
+
318
350
it ( 'should detect kiss_ww' , ( ) => {
319
351
expect ( isPersonZwjEmoji ( '👩❤️💋👩' ) ) . toBeTruthy ( ) ;
320
352
} ) ;
353
+
321
354
it ( 'should not detect girl' , ( ) => {
322
355
expect ( isPersonZwjEmoji ( '👧' ) ) . toBeFalsy ( ) ;
323
356
} ) ;
357
+
324
358
it ( 'should not detect girl_tone5' , ( ) => {
325
359
expect ( isPersonZwjEmoji ( '👧🏿' ) ) . toBeFalsy ( ) ;
326
360
} ) ;
361
+
327
362
it ( 'should not detect man' , ( ) => {
328
363
expect ( isPersonZwjEmoji ( '👨' ) ) . toBeFalsy ( ) ;
329
364
} ) ;
365
+
330
366
it ( 'should not detect woman' , ( ) => {
331
367
expect ( isPersonZwjEmoji ( '👩' ) ) . toBeFalsy ( ) ;
332
368
} ) ;
@@ -341,6 +377,7 @@ describe('gl_emoji', () => {
341
377
) ;
342
378
expect ( isSupported ) . toBeTruthy ( ) ;
343
379
} ) ;
380
+
344
381
it ( 'should gracefully handle empty string without unicode support' , ( ) => {
345
382
const isSupported = isEmojiUnicodeSupported (
346
383
{ } ,
@@ -349,6 +386,7 @@ describe('gl_emoji', () => {
349
386
) ;
350
387
expect ( isSupported ) . toBeFalsy ( ) ;
351
388
} ) ;
389
+
352
390
it ( 'bomb(6.0) with 6.0 support' , ( ) => {
353
391
const emojiKey = 'bomb' ;
354
392
const unicodeSupportMap = Object . assign ( { } , emptySupportMap , {
0 commit comments