Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix-#6: integration test completed for signin component #413

Merged

Conversation

Aswin2255
Copy link
Contributor

@Aswin2255 Aswin2255 commented Jun 10, 2024

The integration test completed for the sign-in component fixed the unit case failure due to the new changes introduced

Summary

An integration test is performed on the sign-in component using the real backend API

Description

To perform the integration test we need to run the backend, also we need to have a test user in the database with the test credentials

Images

image

Issue(s) Address

#6

Prerequisites

Copy link

vercel bot commented Jun 10, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
wanderlust ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 10, 2024 3:33pm
wanderlust-backend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 10, 2024 3:33pm

Copy link

Hey @Aswin2255! Thanks for sticking to the guidelines! High five! 🙌🏻

1 similar comment
Copy link

Hey @Aswin2255! Thanks for sticking to the guidelines! High five! 🙌🏻

Copy link
Owner

@krishnaacharyaa krishnaacharyaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you Ashwin, But please prepare tests for many other scenarios, ideally tests should contain all the scenarios it might go to crazy number,
Can you kindly enhance this to have decent amount of test cases which covers all the scenarios?

@@ -13,7 +13,7 @@ const app = express();
app.use(
cors({
// added origin
origin: FRONTEND_URL,
origin: [FRONTEND_URL, 'http://localhost:3000'],
credentials: true,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since we are doing an integration test with the real API. The jsdom is our frontend and it's default URL is localhost:3000, so if we doesn't include it we will get an cors error during integration test..

@@ -2,7 +2,7 @@
import { http, HttpResponse } from 'msw';

export const handlers = [
http.post('http://localhost:5000/api/auth/email-password/signup', () => {
http.post('http://localhost:8080/api/auth/email-password/signup', () => {
return new HttpResponse(null, {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No hard coding please

import { toast } from 'react-toastify';

interface sucessdata {
status: number;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this used multiple places, can we have a seperate types folder? and make it reusable

@krishnaacharyaa
Copy link
Owner

@Aswin2255

@krishnaacharyaa krishnaacharyaa merged commit ddb013b into krishnaacharyaa:main Jul 10, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adding integration tests in frontend
2 participants