aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/components/OAuth2Button.test.tsx
blob: 49c0f8afb470a2291935f25bd3311cb477485f56 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import React from 'react';
import { render } from '@testing-library/react';
import '@testing-library/jest-dom/extend-expect';
import OAuth2Button from "../../components/OAuth2Button";

test('renders oauth2 sign in button text', () => {
    const { getByText } = render(<OAuth2Button />);
    const button = getByText(/Sign in with Discord/i);
    expect(button).toBeInTheDocument();
});

test("renders fontawesome discord icon", () => {
    const { container } = render(<OAuth2Button/>);
    const icon = container.querySelector(`[data-icon="discord"]`)
    expect(icon).toBeInTheDocument();
})