From 96bb44927bf674aa0cd139ef430921de2d988bc3 Mon Sep 17 00:00:00 2001
From: Joe Banks <joseph@josephbanks.me>
Date: Mon, 28 Sep 2020 04:04:06 +0100
Subject: Add initial tests

---
 src/tests/components/OAuth2Button.test.tsx | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 src/tests/components/OAuth2Button.test.tsx

(limited to 'src/tests/components/OAuth2Button.test.tsx')

diff --git a/src/tests/components/OAuth2Button.test.tsx b/src/tests/components/OAuth2Button.test.tsx
new file mode 100644
index 0000000..53875dc
--- /dev/null
+++ b/src/tests/components/OAuth2Button.test.tsx
@@ -0,0 +1,15 @@
+import React from 'react';
+import { render } from '@testing-library/react';
+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();
+})
-- 
cgit v1.2.3

