Skip to content

Commit

Permalink
adding tests
Browse files Browse the repository at this point in the history
  • Loading branch information
RaeChen07 committed Sep 11, 2023
1 parent dde86a3 commit 35aca2f
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/__tests__/component_test/figure_wrapper.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from 'react';
import { getByRole, render } from '@testing-library/react';
import '@testing-library/jest-dom/extend-expect';

import FigureWrapper from '../../components/figure_wrapper';

describe('FigureWrapper', () => {
it('renders with children and src', () => {

const children = 'This is the caption text';
const src = '';

const { getByText, getByAltText } = render(
<FigureWrapper src={src}>{children}</FigureWrapper>
);

const captionElement = getByText(children);

expect(captionElement).toBeInTheDocument();
});
});

0 comments on commit 35aca2f

Please sign in to comment.