import React from 'react'; import { shallow } from 'enzyme'; import toJson from 'enzyme-to-json'; import Markdown from '../markdown'; describe('Markdown', () => { const props = { data: { ama: '', badgeColor: '0e75b6', badgeLabel: 'Profile views', badgeStyle: 'flat', collaborateOn: '', contact: '', currentLearn: '', currentWork: 'currentWork', devDynamicBlogs: false, funFact: '', githubProfileTrophy: false, githubStats: false, githubStatsOptions: { bgColor: '', cacheSeconds: null, hideBorder: false, locale: 'en', textColor: '', theme: '', titleColor: '', }, helpWith: '', mediumDynamicBlogs: false, rssDynamicBlogs: false, subtitle: 'A passionate frontend developer from India', title: 'title', topLanguages: false, topLanguagesOptions: { bgColor: '', cacheSeconds: null, hideBorder: false, locale: 'en', textColor: '', theme: '', titleColor: '', }, twitterBadge: false, visitorsBadge: false, }, link: { blog: 'blog', collaborateOn: 'collaborateOn', currentWork: 'currentWork', helpWith: 'helpWith', portfolio: 'portfolio', resume: 'resume', }, prefix: { ama: 'šŸ’¬ Ask me about', blog: 'šŸ“ I regularly write articles on', collaborateOn: 'šŸ‘Æ I’m looking to collaborate on', contact: 'šŸ“« How to reach me', currentLearn: '🌱 I’m currently learning', currentWork: 'šŸ”­ I’m currently working on', funFact: '⚔ Fun fact', helpWith: 'šŸ¤ I’m looking for help with', portfolio: 'šŸ‘Øā€šŸ’» All of my projects are available at', resume: 'šŸ“„ Know about my experiences', title: "Hi šŸ‘‹, I'm", }, skills: { javascript: true, express: false, }, social: { dev: 'dev', codechef: '', }, }; it('renders without subtitle', () => { const component = shallow( ); expect(toJson(component)).toMatchSnapshot(); }); it('renders without prefix.title and data.title', () => { const component = shallow( ); expect(toJson(component)).toMatchSnapshot(); }); it('renders topLanguages is true', () => { const component = shallow( ); expect(toJson(component)).toMatchSnapshot(); }); it('renders topLanguages is true and githubStats is true', () => { const component = shallow( ); expect(toJson(component)).toMatchSnapshot(); }); it('renders devDynamicBlogs is true', () => { const component = shallow( ); expect(toJson(component)).toMatchSnapshot(); }); it('renders without link.currentWork', () => { const component = shallow( ); expect(toJson(component)).toMatchSnapshot(); }); it('renders visitorsBadge is true', () => { const component = shallow( ); expect(toJson(component)).toMatchSnapshot(); }); it('renders twitterBadge is true', () => { const component = shallow( ); expect(toJson(component)).toMatchSnapshot(); }); it('renders githubProfileTrophy is true', () => { const component = shallow( ); expect(toJson(component)).toMatchSnapshot(); }); it('renders githubProfileTrophy is true', () => { const component = shallow( ); expect(toJson(component)).toMatchSnapshot(); }); });