-
Notifications
You must be signed in to change notification settings - Fork 46
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
#2296 Use React Testing Library for common-properties tests - Part 2-… #2297
Conversation
… Part 2-final-implementing Signed-off-by: Jerin George <[email protected]>
expect(dropdownList).to.be.length(14); | ||
dropdownList.at(2).simulate("click"); | ||
wrapper.update(); | ||
fireEvent.click(dropdownList[2]); | ||
expect(controller.getControlState({ name: "checkbox3" })).to.equal("visible"); | ||
}); | ||
|
||
// This works in the UI but errorMessages is not updated in test | ||
it.skip("selectColumn control becomes validated if selected item has a dmRole equal to discrete", () => { |
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.
Can you try fixing this test
errorMessages = controller.getErrorMessages(); | ||
expect(controller.getErrorMessages()).to.deep.equal({}); | ||
expect(errorMessages).to.deep.equal({}); | ||
}); | ||
|
||
// This works in the UI but errorMessages is not updated in test | ||
it.skip("selectColumn control become validated if selected item does not have a dmRole equal to discrete", () => { |
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.
Can you try fixing this test
… Part 2-Enabling skipped tests Signed-off-by: Jerin George <[email protected]>
expect(errorMessages.dmMeasurementEqualList.type).to.equal("error"); | ||
}); | ||
// Manually updating the store | ||
sinon.stub(controller, "getErrorMessages") |
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.
How come this is stubbed? This doesn't really test what we want since we are forcing the messages to return the values we expect
dropdownButton.simulate("click"); | ||
dropdownList.at(1).simulate("click"); // Fulfill Condition by selecting item with dmRole input | ||
const getErrorMessage = sinon.stub(controller, "getErrorMessages"); | ||
getErrorMessage.onFirstCall().returns({}); |
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.
Same comment as above. If we are forcing the messages to return {}
then its not really testing that the error messages are cleared. Instead, are you able to verify on the UI side that the error icon appears and disappears after selection?
New PR for this issue : #2331 |
fixes: #2296
Developer's Certificate of Origin 1.1