Skip to content

Commit

Permalink
add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
mehdi-torabiv committed Sep 1, 2024
1 parent b3da6f6 commit 376a6d3
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/components/pages/attestations/StepOne.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import '@testing-library/jest-dom';

import { render, screen } from '@testing-library/react';
import { MemoryRouter } from 'react-router-dom';

import { Provider } from '../../../enums';

import StepOne from './StepOne';

describe('StepOne Component', () => {
it('renders the component with the correct provider', () => {
render(
<MemoryRouter>
<StepOne provider={Provider.Google} handleNextStep={() => {}} />
</MemoryRouter>
);

expect(screen.getByText('Let’s get started!')).toBeInTheDocument();
expect(
screen.getByText('Please authenticate with Google to continue.')
).toBeInTheDocument();
expect(
screen.getByRole('button', { name: /Authorize with Google/i })
).toBeInTheDocument();
});
});

0 comments on commit 376a6d3

Please sign in to comment.