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();
});
});