-
Notifications
You must be signed in to change notification settings - Fork 62
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
[New] Added test cases for pages admin users form #341
[New] Added test cases for pages admin users form #341
Conversation
0211087
to
a407855
Compare
app/javascript/components/pages/admin/users-form/container.spec.js
Outdated
Show resolved
Hide resolved
|
||
it("renders 14 fields", () => { | ||
mountedComponent(<UsersForm mode="new" />, initialState, ["/admin/users"]) | ||
expect(screen.getAllByRole('textbox')).toHaveLength(14) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did this change to 14?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on test mock state, we are rendering 14 text fields in the DOM.
expect(screen.getByText('buttons.save')).toBeInTheDocument() | ||
}); | ||
|
||
it("check the textbox fields length", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before, this test checked that 19 fields were rendered. I think you will need to check that the other 5 fields were rendered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They were only 14 textbox fields rendered in the DOM
c3eb033
to
eb17c74
Compare
eb17c74
to
e67baa6
Compare
51193db
into
primeroIMS:develop_react_upgrade
Added test cases for pages admin users form component.