Skip to content

Commit

Permalink
Merge branch 'main' into camille-frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
CamSalter committed Feb 1, 2023
2 parents 716e981 + e530fdd commit c54f001
Show file tree
Hide file tree
Showing 7 changed files with 16,357 additions and 8,013 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["@babel/preset-env", "@babel/preset-react"]
}
12 changes: 12 additions & 0 deletions __tests__/jest.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import '@testing-library/jest-dom';
import React from 'react';
import { render, screen, cleanup } from '@testing-library/react';
import LandingPage from '../client/containers/LandingPage';
// import LoginForm from '../client/components/LoginForm.jsx';

//landing page
test('Landing page should render', () => {
render(<LandingPage />);
const LandingPageElement = screen.getByTestId('landing');
expect(LandingPageElement).toBeInTheDocument();
});
59 changes: 59 additions & 0 deletions __tests__/supertest.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
const request = require("supertest");
const server = 'http://localhost:3000';

//testing post route to user/verify
describe('Requests to /user/verify should work', () => {
test('POST /user/verify', (done) => {
request(server)
.post("/user/verify")
.send({
name: 'TESTNAME',
email: 'TESTEMAIL',
password: 'TESTPASSWORD',
})
.expect(200)
.end((err, res) => {
if (err) return done(err);
return done();
})
});
});

//test get request for user/:user_id
describe('Requests to /user/:user_id should work', () => {
test('GET /user/user_id', (done) => {
request(server)
.get("/user/1")
.expect(200)
.end((err, res) => {
if (err) return done(err);
return done();
})
});
});

//testing get route to record/:record_id
describe('Requests to /record/:record_id should work', () => {
test('GET /record/:record_id', (done) => {
request(server)
.post("/record/1")
.expect(200)
.end((err, res) => {
if (err) return done(err);
return done();
})
});
});

//testing get route to client/:client_id
describe('Requests to /user/verify should work', () => {
test('GET /client/:client_id', (done) => {
request(server)
.post("/client/1")
.expect(200)
.end((err, res) => {
if (err) return done(err);
return done();
})
});
});
1 change: 1 addition & 0 deletions client/containers/LandingPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ const LandingPage = ({ user, setUser }) => {
Signup
</button>
</div>

{showModal()}
</div>
);
Expand Down
Loading

0 comments on commit c54f001

Please sign in to comment.