diff options
Diffstat (limited to 'spec/frontend/emoji')
-rw-r--r-- | spec/frontend/emoji/components/category_spec.js | 10 | ||||
-rw-r--r-- | spec/frontend/emoji/components/utils_spec.js | 4 | ||||
-rw-r--r-- | spec/frontend/emoji/index_spec.js | 98 |
3 files changed, 56 insertions, 56 deletions
diff --git a/spec/frontend/emoji/components/category_spec.js b/spec/frontend/emoji/components/category_spec.js index 82dc0cdc250..90816f28d5b 100644 --- a/spec/frontend/emoji/components/category_spec.js +++ b/spec/frontend/emoji/components/category_spec.js @@ -22,7 +22,7 @@ describe('Emoji category component', () => { }); it('renders emoji groups', () => { - expect(wrapper.findAll(EmojiGroup).length).toBe(2); + expect(wrapper.findAllComponents(EmojiGroup).length).toBe(2); }); it('renders group', async () => { @@ -30,19 +30,19 @@ describe('Emoji category component', () => { // eslint-disable-next-line no-restricted-syntax await wrapper.setData({ renderGroup: true }); - expect(wrapper.find(EmojiGroup).attributes('rendergroup')).toBe('true'); + expect(wrapper.findComponent(EmojiGroup).attributes('rendergroup')).toBe('true'); }); it('renders group on appear', async () => { - wrapper.find(GlIntersectionObserver).vm.$emit('appear'); + wrapper.findComponent(GlIntersectionObserver).vm.$emit('appear'); await nextTick(); - expect(wrapper.find(EmojiGroup).attributes('rendergroup')).toBe('true'); + expect(wrapper.findComponent(EmojiGroup).attributes('rendergroup')).toBe('true'); }); it('emits appear event on appear', async () => { - wrapper.find(GlIntersectionObserver).vm.$emit('appear'); + wrapper.findComponent(GlIntersectionObserver).vm.$emit('appear'); await nextTick(); diff --git a/spec/frontend/emoji/components/utils_spec.js b/spec/frontend/emoji/components/utils_spec.js index 56f514ee9a8..a17ddb3bb9a 100644 --- a/spec/frontend/emoji/components/utils_spec.js +++ b/spec/frontend/emoji/components/utils_spec.js @@ -4,13 +4,13 @@ import { getFrequentlyUsedEmojis, addToFrequentlyUsed } from '~/emoji/components jest.mock('~/lib/utils/cookies'); describe('getFrequentlyUsedEmojis', () => { - it('it returns null when no saved emojis set', () => { + it('returns null when no saved emojis set', () => { jest.spyOn(Cookies, 'get').mockReturnValue(null); expect(getFrequentlyUsedEmojis()).toBe(null); }); - it('it returns frequently used emojis object', () => { + it('returns frequently used emojis object', () => { jest.spyOn(Cookies, 'get').mockReturnValue('thumbsup,thumbsdown'); expect(getFrequentlyUsedEmojis()).toEqual({ diff --git a/spec/frontend/emoji/index_spec.js b/spec/frontend/emoji/index_spec.js index dc8f50e0e4b..36c3eeb5a52 100644 --- a/spec/frontend/emoji/index_spec.js +++ b/spec/frontend/emoji/index_spec.js @@ -120,177 +120,177 @@ describe('emoji', () => { describe('isFlagEmoji', () => { it('should gracefully handle empty string', () => { - expect(isFlagEmoji('')).toBeFalsy(); + expect(isFlagEmoji('')).toBe(false); }); it('should detect flag_ac', () => { - expect(isFlagEmoji('π¦π¨')).toBeTruthy(); + expect(isFlagEmoji('π¦π¨')).toBe(true); }); it('should detect flag_us', () => { - expect(isFlagEmoji('πΊπΈ')).toBeTruthy(); + expect(isFlagEmoji('πΊπΈ')).toBe(true); }); it('should detect flag_zw', () => { - expect(isFlagEmoji('πΏπΌ')).toBeTruthy(); + expect(isFlagEmoji('πΏπΌ')).toBe(true); }); it('should not detect flags', () => { - expect(isFlagEmoji('π')).toBeFalsy(); + expect(isFlagEmoji('π')).toBe(false); }); it('should not detect triangular_flag_on_post', () => { - expect(isFlagEmoji('π©')).toBeFalsy(); + expect(isFlagEmoji('π©')).toBe(false); }); it('should not detect single letter', () => { - expect(isFlagEmoji('π¦')).toBeFalsy(); + expect(isFlagEmoji('π¦')).toBe(false); }); it('should not detect >2 letters', () => { - expect(isFlagEmoji('π¦π§π¨')).toBeFalsy(); + expect(isFlagEmoji('π¦π§π¨')).toBe(false); }); }); describe('isRainbowFlagEmoji', () => { it('should gracefully handle empty string', () => { - expect(isRainbowFlagEmoji('')).toBeFalsy(); + expect(isRainbowFlagEmoji('')).toBe(false); }); it('should detect rainbow_flag', () => { - expect(isRainbowFlagEmoji('π³π')).toBeTruthy(); + expect(isRainbowFlagEmoji('π³π')).toBe(true); }); it("should not detect flag_white on its' own", () => { - expect(isRainbowFlagEmoji('π³')).toBeFalsy(); + expect(isRainbowFlagEmoji('π³')).toBe(false); }); it("should not detect rainbow on its' own", () => { - expect(isRainbowFlagEmoji('π')).toBeFalsy(); + expect(isRainbowFlagEmoji('π')).toBe(false); }); it('should not detect flag_white with something else', () => { - expect(isRainbowFlagEmoji('π³π΅')).toBeFalsy(); + expect(isRainbowFlagEmoji('π³π΅')).toBe(false); }); }); describe('isKeycapEmoji', () => { it('should gracefully handle empty string', () => { - expect(isKeycapEmoji('')).toBeFalsy(); + expect(isKeycapEmoji('')).toBe(false); }); it('should detect one(keycap)', () => { - expect(isKeycapEmoji('1οΈβ£')).toBeTruthy(); + expect(isKeycapEmoji('1οΈβ£')).toBe(true); }); it('should detect nine(keycap)', () => { - expect(isKeycapEmoji('9οΈβ£')).toBeTruthy(); + expect(isKeycapEmoji('9οΈβ£')).toBe(true); }); it('should not detect ten(keycap)', () => { - expect(isKeycapEmoji('π')).toBeFalsy(); + expect(isKeycapEmoji('π')).toBe(false); }); it('should not detect hash(keycap)', () => { - expect(isKeycapEmoji('#β£')).toBeFalsy(); + expect(isKeycapEmoji('#β£')).toBe(false); }); }); describe('isSkinToneComboEmoji', () => { it('should gracefully handle empty string', () => { - expect(isSkinToneComboEmoji('')).toBeFalsy(); + expect(isSkinToneComboEmoji('')).toBe(false); }); it('should detect hand_splayed_tone5', () => { - expect(isSkinToneComboEmoji('ππΏ')).toBeTruthy(); + expect(isSkinToneComboEmoji('ππΏ')).toBe(true); }); it('should not detect hand_splayed', () => { - expect(isSkinToneComboEmoji('π')).toBeFalsy(); + expect(isSkinToneComboEmoji('π')).toBe(false); }); it('should detect lifter_tone1', () => { - expect(isSkinToneComboEmoji('ππ»')).toBeTruthy(); + expect(isSkinToneComboEmoji('ππ»')).toBe(true); }); it('should not detect lifter', () => { - expect(isSkinToneComboEmoji('π')).toBeFalsy(); + expect(isSkinToneComboEmoji('π')).toBe(false); }); it('should detect rowboat_tone4', () => { - expect(isSkinToneComboEmoji('π£πΎ')).toBeTruthy(); + expect(isSkinToneComboEmoji('π£πΎ')).toBe(true); }); it('should not detect rowboat', () => { - expect(isSkinToneComboEmoji('π£')).toBeFalsy(); + expect(isSkinToneComboEmoji('π£')).toBe(false); }); it('should not detect individual tone emoji', () => { - expect(isSkinToneComboEmoji('π»')).toBeFalsy(); + expect(isSkinToneComboEmoji('π»')).toBe(false); }); }); describe('isHorceRacingSkinToneComboEmoji', () => { it('should gracefully handle empty string', () => { - expect(isHorceRacingSkinToneComboEmoji('')).toBeFalsy(); + expect(isHorceRacingSkinToneComboEmoji('')).toBeUndefined(); }); it('should detect horse_racing_tone2', () => { - expect(isHorceRacingSkinToneComboEmoji('ππΌ')).toBeTruthy(); + expect(isHorceRacingSkinToneComboEmoji('ππΌ')).toBe(true); }); it('should not detect horse_racing', () => { - expect(isHorceRacingSkinToneComboEmoji('π')).toBeFalsy(); + expect(isHorceRacingSkinToneComboEmoji('π')).toBe(false); }); }); describe('isPersonZwjEmoji', () => { it('should gracefully handle empty string', () => { - expect(isPersonZwjEmoji('')).toBeFalsy(); + expect(isPersonZwjEmoji('')).toBe(false); }); it('should detect couple_mm', () => { - expect(isPersonZwjEmoji('π¨ββ€οΈβπ¨')).toBeTruthy(); + expect(isPersonZwjEmoji('π¨ββ€οΈβπ¨')).toBe(true); }); it('should not detect couple_with_heart', () => { - expect(isPersonZwjEmoji('π')).toBeFalsy(); + expect(isPersonZwjEmoji('π')).toBe(false); }); it('should not detect couplekiss', () => { - expect(isPersonZwjEmoji('π')).toBeFalsy(); + expect(isPersonZwjEmoji('π')).toBe(false); }); it('should detect family_mmb', () => { - expect(isPersonZwjEmoji('π¨βπ¨βπ¦')).toBeTruthy(); + expect(isPersonZwjEmoji('π¨βπ¨βπ¦')).toBe(true); }); it('should detect family_mwgb', () => { - expect(isPersonZwjEmoji('π¨βπ©βπ§βπ¦')).toBeTruthy(); + expect(isPersonZwjEmoji('π¨βπ©βπ§βπ¦')).toBe(true); }); it('should not detect family', () => { - expect(isPersonZwjEmoji('πͺ')).toBeFalsy(); + expect(isPersonZwjEmoji('πͺ')).toBe(false); }); it('should detect kiss_ww', () => { - expect(isPersonZwjEmoji('π©ββ€οΈβπβπ©')).toBeTruthy(); + expect(isPersonZwjEmoji('π©ββ€οΈβπβπ©')).toBe(true); }); it('should not detect girl', () => { - expect(isPersonZwjEmoji('π§')).toBeFalsy(); + expect(isPersonZwjEmoji('π§')).toBe(false); }); it('should not detect girl_tone5', () => { - expect(isPersonZwjEmoji('π§πΏ')).toBeFalsy(); + expect(isPersonZwjEmoji('π§πΏ')).toBe(false); }); it('should not detect man', () => { - expect(isPersonZwjEmoji('π¨')).toBeFalsy(); + expect(isPersonZwjEmoji('π¨')).toBe(false); }); it('should not detect woman', () => { - expect(isPersonZwjEmoji('π©')).toBeFalsy(); + expect(isPersonZwjEmoji('π©')).toBe(false); }); }); @@ -298,13 +298,13 @@ describe('emoji', () => { it('should gracefully handle empty string with unicode support', () => { const isSupported = isEmojiUnicodeSupported({ '1.0': true }, '', '1.0'); - expect(isSupported).toBeTruthy(); + expect(isSupported).toBe(true); }); it('should gracefully handle empty string without unicode support', () => { const isSupported = isEmojiUnicodeSupported({}, '', '1.0'); - expect(isSupported).toBeFalsy(); + expect(isSupported).toBeUndefined(); }); it('bomb(6.0) with 6.0 support', () => { @@ -316,7 +316,7 @@ describe('emoji', () => { emojiFixtureMap[emojiKey].unicodeVersion, ); - expect(isSupported).toBeTruthy(); + expect(isSupported).toBe(true); }); it('bomb(6.0) without 6.0 support', () => { @@ -328,7 +328,7 @@ describe('emoji', () => { emojiFixtureMap[emojiKey].unicodeVersion, ); - expect(isSupported).toBeFalsy(); + expect(isSupported).toBe(false); }); it('bomb(6.0) without 6.0 but with 9.0 support', () => { @@ -340,7 +340,7 @@ describe('emoji', () => { emojiFixtureMap[emojiKey].unicodeVersion, ); - expect(isSupported).toBeFalsy(); + expect(isSupported).toBe(false); }); it('construction_worker_tone5(8.0) without skin tone modifier support', () => { @@ -367,7 +367,7 @@ describe('emoji', () => { emojiFixtureMap[emojiKey].unicodeVersion, ); - expect(isSupported).toBeFalsy(); + expect(isSupported).toBe(false); }); it('use native keycap on >=57 chrome', () => { @@ -386,7 +386,7 @@ describe('emoji', () => { emojiFixtureMap[emojiKey].unicodeVersion, ); - expect(isSupported).toBeTruthy(); + expect(isSupported).toBe(true); }); it('fallback keycap on <57 chrome', () => { @@ -405,7 +405,7 @@ describe('emoji', () => { emojiFixtureMap[emojiKey].unicodeVersion, ); - expect(isSupported).toBeFalsy(); + expect(isSupported).toBe(false); }); }); |