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

[New] Added test cases for pages admin users form #341

Conversation

Srinivas9933
Copy link
Contributor

Added test cases for pages admin users form component.

  • container.spec.js

@jtoliver-quoin jtoliver-quoin force-pushed the develop_react_upgrade branch 2 times, most recently from 0211087 to a407855 Compare November 1, 2023 15:49
@dhernandez-quoin dhernandez-quoin changed the base branch from develop_react_upgrade to main January 25, 2024 17:26
@dhernandez-quoin dhernandez-quoin changed the base branch from main to develop_react_upgrade January 25, 2024 17:26
@dhernandez-quoin dhernandez-quoin self-assigned this Feb 9, 2024

it("renders 14 fields", () => {
mountedComponent(<UsersForm mode="new" />, initialState, ["/admin/users"])
expect(screen.getAllByRole('textbox')).toHaveLength(14)
Copy link
Contributor

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?

Copy link
Contributor Author

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", () => {
Copy link
Contributor

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.

Copy link
Contributor Author

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

@Srinivas9933 Srinivas9933 force-pushed the trigyn-testcases-pages-admin-users-form branch 2 times, most recently from c3eb033 to eb17c74 Compare April 18, 2024 04:00
@Srinivas9933 Srinivas9933 force-pushed the trigyn-testcases-pages-admin-users-form branch from eb17c74 to e67baa6 Compare April 24, 2024 05:55
@dhernandez-quoin dhernandez-quoin merged commit 51193db into primeroIMS:develop_react_upgrade May 29, 2024
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants