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

132 cypress test for contact us form #148

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

Tausifqureshi786
Copy link

Description

Edited the current contact-form.tsx file to add some helper attributes to elements and added the test suite for the isolated component using cypress.

  • Added 'data-cy' attributes for the name, email and message input fields and error span elements in "../src/components/molecules/contact-form/contact-form.tsx" file in order to safely fetch them in the cypress tests
  • Added test suite for contact-form component handling three cases:
    -- No name, email and message is provided
    -- All three proper inputs are provided.
    -- Only valid email is provided

Related Issue

Resolves: #132

Motivation and Context

n/a

How Has This Been Tested?

Screenshots (if appropriate):

Case 1:
Screenshot 2023-05-25 at 4 54 48 PM

Case 2:
Screenshot 2023-05-25 at 4 55 34 PM

Case 3:
Screenshot 2023-05-25 at 4 56 02 PM

Add 'data-cy' attribute value to the inputs, error spans, headers and the send message button to safely fetch them in cypress tests
Add test suite for contact us component for the given test cases in the issue TechIsHiring#132
@vercel
Copy link

vercel bot commented May 25, 2023

Someone is attempting to deploy a commit to a Personal Account owned by @TechIsHiring on Vercel.

@TechIsHiring first needs to authorize it.

@vercel
Copy link

vercel bot commented May 29, 2023

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

Name Status Preview Comments Updated (UTC)
techishiring-website ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 29, 2023 0:51am

Copy link
Collaborator

@chadstewart chadstewart left a comment

Choose a reason for hiding this comment

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

Thanks so much for your contribution. So just wanted to request some changes.

Outside of what I added, could you test the input fields separately please? Also could you add tests where you test where the input fields have have invalid characters or is in an invalid format and not just empty please?

Thanks much and looking forward to your update!

@chadstewart
Copy link
Collaborator

Hey @Tausifqureshi786, just wanted to reach out and ask if you were able to make any further progress on this PR?

@dgodongm
Copy link
Contributor

@chadstewart @Tausifqureshi786 Let me know if you'd like me to finish this up. In terms of consistency with https://github.com/TechIsHiring/techishiring-website/blob/dev/src/components/organisms/footer/footer.cy.tsx, should the test file here be moved to be in same folder as the component?

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.

[Developer Experience]: Add Cypress tests for 'Contact Us' form
3 participants