Skip to content

Commit

Permalink
test: apply test at Resume TitleTooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
hyesungoh committed Apr 21, 2022
1 parent 7efbaa2 commit 68db326
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/resume/src/components/SkillsSection/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ const mockSkills: ISkills = {
list: [{ name: 'skill name', descriptions: ['skill dsc'] }],
};

describe('resume - components - Li index', () => {
it('should render same things with Li component', () => {
describe('resume - components - SkillsSection index', () => {
it('should render same things with SkillsSection component', () => {
const { container: defaultContainer } = render(<Default {...mockSkills} />);
const { container } = render(<SkillsSection {...mockSkills} />);
expect(defaultContainer).toEqual(container);
Expand Down
28 changes: 28 additions & 0 deletions apps/resume/src/components/TitleTooltip/TitleTooltip.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React from 'react';
import { render, screen } from '@testing-library/react';

import TitleTooltip from './TitleTooltip';

describe('resume - components - TitleTooltip', () => {
it('should render props', () => {
const mockProps = {
text: 'title',
githubLink: 'github link',
otherLink: 'github link',
};

render(<TitleTooltip {...mockProps} />);
expect(screen.getByText(mockProps.text)).toBeInTheDocument();
});

it('should not render button when does not have links', () => {
const mockProps = {
text: 'title',
githubLink: null,
otherLink: null,
};

render(<TitleTooltip {...mockProps} />);
expect(screen.queryByRole('button')).not.toBeInTheDocument();
});
});
19 changes: 19 additions & 0 deletions apps/resume/src/components/TitleTooltip/index.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from 'react';
import { render } from '@testing-library/react';

import Default from './index';
import TitleTooltip from './TitleTooltip';

const mockProps = {
text: 'title',
githubLink: 'github link',
otherLink: 'github link',
};

describe('resume - components - TitleTooltip index', () => {
it('should render same things with TitleTooltip component', () => {
const { container: defaultContainer } = render(<Default {...mockProps} />);
const { container } = render(<TitleTooltip {...mockProps} />);
expect(defaultContainer).toEqual(container);
});
});

0 comments on commit 68db326

Please sign in to comment.