Skip to content

Checkbox + Dropdown Question Tests#193

Open
surbhi-gulati wants to merge 18 commits into
mainfrom
sg-questiontests
Open

Checkbox + Dropdown Question Tests#193
surbhi-gulati wants to merge 18 commits into
mainfrom
sg-questiontests

Conversation

@surbhi-gulati

Copy link
Copy Markdown
Contributor

Closes #189.

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

@vercel

vercel Bot commented Nov 1, 2022

Copy link
Copy Markdown

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)

@deanframe deanframe left a comment

Copy link
Copy Markdown
Contributor

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");

@deanframe deanframe Nov 2, 2022

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

@jzhzhang66 jzhzhang66 left a comment

Copy link
Copy Markdown
Contributor

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