From 768464477daac2b90bc0d7ea39014f19271fcf5b Mon Sep 17 00:00:00 2001 From: alxshelepenok Date: Thu, 9 May 2019 16:34:32 +0300 Subject: [PATCH] test: improved coverage --- src/utils/get-contact-href.test.js | 11 +++++++++++ src/utils/get-icon.test.js | 12 ++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 src/utils/get-contact-href.test.js create mode 100644 src/utils/get-icon.test.js diff --git a/src/utils/get-contact-href.test.js b/src/utils/get-contact-href.test.js new file mode 100644 index 0000000..1cf3097 --- /dev/null +++ b/src/utils/get-contact-href.test.js @@ -0,0 +1,11 @@ +// @flow +import getContactHref from './get-contact-href'; + +test('getContactHref', () => { + expect(getContactHref('twitter', '#')).toBe('https://www.twitter.com/#'); + expect(getContactHref('github', '#')).toBe('https://github.com/#'); + expect(getContactHref('email', '#')).toBe('mailto:#'); + expect(getContactHref('vkontakte', '#')).toBe('https://vk.com/#'); + expect(getContactHref('telegram', '#')).toBe('telegram:#'); + expect(getContactHref('rss', '#')).toBe('#'); +}); diff --git a/src/utils/get-icon.test.js b/src/utils/get-icon.test.js new file mode 100644 index 0000000..1c3d485 --- /dev/null +++ b/src/utils/get-icon.test.js @@ -0,0 +1,12 @@ +// @flow +import getIcon from './get-icon'; +import { ICONS } from '../constants'; + +test('getIcon', () => { + expect(getIcon('twitter')).toBe(ICONS.TWITTER); + expect(getIcon('github')).toBe(ICONS.GITHUB); + expect(getIcon('vkontakte')).toBe(ICONS.VKONTAKTE); + expect(getIcon('telegram')).toEqual(ICONS.TELEGRAM); + expect(getIcon('email')).toEqual(ICONS.EMAIL); + expect(getIcon('rss')).toEqual(ICONS.RSS); +});