Dominic Kenny - 100 | Github 101 | | 102 | LinkedIn 103 | 104 |
105 |Connor Donahue - 106 | Github 107 | | 108 | LinkedIn 109 | 110 |
111 |Wilson Wu - 112 | Github 113 | | 114 | LinkedIn 115 | 116 |
117 |David Tezza - 118 | Github 119 | | 120 | LinkedIn 121 | 122 |
123 | 124 | ## License 125 | 126 | [MIT License](./LICENSE.md) 127 | -------------------------------------------------------------------------------- /__tests__/server/server.test.js: -------------------------------------------------------------------------------- 1 | import request from 'supertest'; 2 | 3 | import app from '../../server/server.js'; 4 | const server = 'http://localhost:3030'; 5 | 6 | describe('Route Integration', () => { 7 | describe('/404Route', () => { 8 | test('respond with 404 status and text/html content type', () => { 9 | return request(server) 10 | .get('/fakeroute') 11 | .expect('Content-Type', /text\/html/) 12 | .expect(404); 13 | }); 14 | }); 15 | 16 | describe('/user', () => { 17 | describe('/user/login', () => { 18 | test('respond with 400 status for missing password to /login', () => { 19 | return request(server) 20 | .post('/user/login') 21 | .send({ username: 'KlusterFunk' }) 22 | .expect('Content-Type', /json/) 23 | .expect(400, { err: 'Username and password required' }); 24 | }); 25 | test('respond with 400 status for missing username to /login', () => { 26 | return request(server) 27 | .post('/user/login') 28 | .send({ password: 'KlusterFunk' }) 29 | .expect('Content-Type', /json/) 30 | .expect(400, { err: 'Username and password required' }); 31 | }); 32 | }); 33 | 34 | describe('/user/signup', () => { 35 | test('respond with 400 status for missing password to /signup', () => { 36 | return request(server) 37 | .post('/user/signup') 38 | .send({ username: 'KlusterFunk' }) 39 | .expect('Content-Type', /json/) 40 | .expect(400, { err: 'Username and password required' }); 41 | }); 42 | test('respond with 400 status for missing username to /signup', () => { 43 | return request(server) 44 | .post('/user/signup') 45 | .send({ password: 'KlusterFunk' }) 46 | .expect('Content-Type', /json/) 47 | .expect(400, { err: 'Username and password required' }); 48 | }); 49 | }); 50 | }); 51 | }); 52 | -------------------------------------------------------------------------------- /__tests__/setup.js: -------------------------------------------------------------------------------- 1 | import { afterEach } from 'vitest'; 2 | import { cleanup } from '@testing-library/react'; 3 | import '@testing-library/jest-dom/vitest'; 4 | 5 | // runs a cleanup after each test case (e.g. clearing jsdom) 6 | afterEach(() => { 7 | cleanup(); 8 | }); 9 | -------------------------------------------------------------------------------- /__tests__/src/App.test.jsx: -------------------------------------------------------------------------------- 1 | import { render, screen } from '@testing-library/react'; 2 | import { BrowserRouter, MemoryRouter } from 'react-router-dom'; 3 | 4 | import App from '/Users/Donahue/Documents/gits/ClusterFunk/src/App.jsx'; 5 | import 'react-router-dom'; 6 | 7 | describe('App', () => { 8 | test('renders App', () => { 9 | render( 10 |7 | KlusterFunk is a monitoring tool, built to visualize metrics from local 8 | kafka clusters, showing you a real-time, live-updating graph of those 9 | metrics. 10 |
11 |