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

Checkbox + Dropdown Question Tests #193

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open

Conversation

surbhi-gulati
Copy link
Contributor

Closes #189.

  • Add Jest testing to CheckboxQuestion & DropdownQuestion files
  • Give components data test IDs
  • Refactor files in to own directories with tests

@vercel
Copy link

vercel bot commented Nov 1, 2022

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

Name Status Preview Updated
application-portal ✅ Ready (Inspect) Visit Preview Nov 28, 2022 at 4:40AM (UTC)

Copy link
Contributor

@deanframe deanframe left a comment

Choose a reason for hiding this comment

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

Looks good but asked a couple questions

const confirmedDialogText = screen.getByTestId('dropdown-question');

expect(confirmedDialogText.textContent).toContain(exampleContent);
expect(confirmedDialogText.textContent).toContain("Select");
Copy link
Contributor

@deanframe deanframe Nov 2, 2022

Choose a reason for hiding this comment

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

should we also be checking that the correct dropdown options render when it is clicked?

Copy link
Contributor

Choose a reason for hiding this comment

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

^^ this is a rlly good point!

@jzhzhang66 jzhzhang66 self-requested a review November 2, 2022 20:43
Copy link
Contributor

@jzhzhang66 jzhzhang66 left a comment

Choose a reason for hiding this comment

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

Thanks for working on this Surbhi!

+1 to Dean's comment and also could you please add tests in both files for

  1. when a question is required - there should be the text that says 'this quesiton is required ' or something
  2. when the question is disabled you shouldn't be able to click anything

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.

Jest testing - QUESTIONS (Checkbox + Dropdown)
3 participants