diff options
author | jerasmus <jerasmus@gitlab.com> | 2018-10-15 12:42:24 +0200 |
---|---|---|
committer | jerasmus <jerasmus@gitlab.com> | 2018-10-15 12:42:24 +0200 |
commit | 58f29d5f855ea2e1411b99804a74710483a13f90 (patch) | |
tree | 0b06ecd3c0bb1bcf3d3c6660c2bc49eefaff08b2 /spec/javascripts/emoji_spec.js | |
parent | 0572da24c990fc01d88acfbd32728221e3e3a711 (diff) | |
parent | a9827357186e38e5732d8dae23d9d02b1f4c7218 (diff) | |
download | gitlab-ce-58f29d5f855ea2e1411b99804a74710483a13f90.tar.gz |
Merge branch 'master' into 48746-fix-files-uploaded-in-base6448746-fix-files-uploaded-in-base64
Diffstat (limited to 'spec/javascripts/emoji_spec.js')
-rw-r--r-- | spec/javascripts/emoji_spec.js | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/spec/javascripts/emoji_spec.js b/spec/javascripts/emoji_spec.js index 124d91f4477..629422780e8 100644 --- a/spec/javascripts/emoji_spec.js +++ b/spec/javascripts/emoji_spec.js @@ -140,6 +140,7 @@ describe('gl_emoji', () => { }, ); }); + it('bomb emoji with sprite fallback', () => { const emojiKey = 'bomb'; const markup = glEmojiTag(emojiFixtureMap[emojiKey].name, { @@ -195,24 +196,31 @@ describe('gl_emoji', () => { it('should gracefully handle empty string', () => { expect(isFlagEmoji('')).toBeFalsy(); }); + it('should detect flag_ac', () => { expect(isFlagEmoji('π¦π¨')).toBeTruthy(); }); + it('should detect flag_us', () => { expect(isFlagEmoji('πΊπΈ')).toBeTruthy(); }); + it('should detect flag_zw', () => { expect(isFlagEmoji('πΏπΌ')).toBeTruthy(); }); + it('should not detect flags', () => { expect(isFlagEmoji('π')).toBeFalsy(); }); + it('should not detect triangular_flag_on_post', () => { expect(isFlagEmoji('π©')).toBeFalsy(); }); + it('should not detect single letter', () => { expect(isFlagEmoji('π¦')).toBeFalsy(); }); + it('should not detect >2 letters', () => { expect(isFlagEmoji('π¦π§π¨')).toBeFalsy(); }); @@ -222,15 +230,19 @@ describe('gl_emoji', () => { it('should gracefully handle empty string', () => { expect(isRainbowFlagEmoji('')).toBeFalsy(); }); + it('should detect rainbow_flag', () => { expect(isRainbowFlagEmoji('π³π')).toBeTruthy(); }); + it('should not detect flag_white on its\' own', () => { expect(isRainbowFlagEmoji('π³')).toBeFalsy(); }); + it('should not detect rainbow on its\' own', () => { expect(isRainbowFlagEmoji('π')).toBeFalsy(); }); + it('should not detect flag_white with something else', () => { expect(isRainbowFlagEmoji('π³π΅')).toBeFalsy(); }); @@ -240,15 +252,19 @@ describe('gl_emoji', () => { it('should gracefully handle empty string', () => { expect(isKeycapEmoji('')).toBeFalsy(); }); + it('should detect one(keycap)', () => { expect(isKeycapEmoji('1οΈβ£')).toBeTruthy(); }); + it('should detect nine(keycap)', () => { expect(isKeycapEmoji('9οΈβ£')).toBeTruthy(); }); + it('should not detect ten(keycap)', () => { expect(isKeycapEmoji('π')).toBeFalsy(); }); + it('should not detect hash(keycap)', () => { expect(isKeycapEmoji('#β£')).toBeFalsy(); }); @@ -258,24 +274,31 @@ describe('gl_emoji', () => { it('should gracefully handle empty string', () => { expect(isSkinToneComboEmoji('')).toBeFalsy(); }); + it('should detect hand_splayed_tone5', () => { expect(isSkinToneComboEmoji('ππΏ')).toBeTruthy(); }); + it('should not detect hand_splayed', () => { expect(isSkinToneComboEmoji('π')).toBeFalsy(); }); + it('should detect lifter_tone1', () => { expect(isSkinToneComboEmoji('ππ»')).toBeTruthy(); }); + it('should not detect lifter', () => { expect(isSkinToneComboEmoji('π')).toBeFalsy(); }); + it('should detect rowboat_tone4', () => { expect(isSkinToneComboEmoji('π£πΎ')).toBeTruthy(); }); + it('should not detect rowboat', () => { expect(isSkinToneComboEmoji('π£')).toBeFalsy(); }); + it('should not detect individual tone emoji', () => { expect(isSkinToneComboEmoji('π»')).toBeFalsy(); }); @@ -285,9 +308,11 @@ describe('gl_emoji', () => { it('should gracefully handle empty string', () => { expect(isHorceRacingSkinToneComboEmoji('')).toBeFalsy(); }); + it('should detect horse_racing_tone2', () => { expect(isHorceRacingSkinToneComboEmoji('ππΌ')).toBeTruthy(); }); + it('should not detect horse_racing', () => { expect(isHorceRacingSkinToneComboEmoji('π')).toBeFalsy(); }); @@ -297,36 +322,47 @@ describe('gl_emoji', () => { it('should gracefully handle empty string', () => { expect(isPersonZwjEmoji('')).toBeFalsy(); }); + it('should detect couple_mm', () => { expect(isPersonZwjEmoji('π¨ββ€οΈβπ¨')).toBeTruthy(); }); + it('should not detect couple_with_heart', () => { expect(isPersonZwjEmoji('π')).toBeFalsy(); }); + it('should not detect couplekiss', () => { expect(isPersonZwjEmoji('π')).toBeFalsy(); }); + it('should detect family_mmb', () => { expect(isPersonZwjEmoji('π¨βπ¨βπ¦')).toBeTruthy(); }); + it('should detect family_mwgb', () => { expect(isPersonZwjEmoji('π¨βπ©βπ§βπ¦')).toBeTruthy(); }); + it('should not detect family', () => { expect(isPersonZwjEmoji('πͺ')).toBeFalsy(); }); + it('should detect kiss_ww', () => { expect(isPersonZwjEmoji('π©ββ€οΈβπβπ©')).toBeTruthy(); }); + it('should not detect girl', () => { expect(isPersonZwjEmoji('π§')).toBeFalsy(); }); + it('should not detect girl_tone5', () => { expect(isPersonZwjEmoji('π§πΏ')).toBeFalsy(); }); + it('should not detect man', () => { expect(isPersonZwjEmoji('π¨')).toBeFalsy(); }); + it('should not detect woman', () => { expect(isPersonZwjEmoji('π©')).toBeFalsy(); }); @@ -341,6 +377,7 @@ describe('gl_emoji', () => { ); expect(isSupported).toBeTruthy(); }); + it('should gracefully handle empty string without unicode support', () => { const isSupported = isEmojiUnicodeSupported( {}, @@ -349,6 +386,7 @@ describe('gl_emoji', () => { ); expect(isSupported).toBeFalsy(); }); + it('bomb(6.0) with 6.0 support', () => { const emojiKey = 'bomb'; const unicodeSupportMap = Object.assign({}, emptySupportMap, { |