diff options
author | Johann Hubert Sonntagbauer <johann.sonntagbauer@gmail.com> | 2018-10-09 20:01:49 +0300 |
---|---|---|
committer | Johann Hubert Sonntagbauer <johann.sonntagbauer@gmail.com> | 2018-10-09 20:01:49 +0300 |
commit | 2a76e04091211c03684d236230331d6eabdf748e (patch) | |
tree | 8e1d9bbe0391095cf1c1a183a4e12315558b9c78 /spec/javascripts/emoji_spec.js | |
parent | 10836664487a771319e2d97dd7b9011dcd017f14 (diff) |
enable jasmine/new-line-between-declarations
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, { |