-
Notifications
You must be signed in to change notification settings - Fork 6
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
UIREQ-876: UI tests replacement with RTL/Jest for CancelRequestDialog.js #1069
Conversation
BigTest Unit Test Statistics134 tests ±0 134 ✔️ ±0 14s ⏱️ -1s Results for commit 9cb9c25. ± Comparison against base commit 54c04a5. This pull request removes 4 and adds 4 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
src/CancelRequestDialog.test.js
Outdated
request: { | ||
id: 'ad038163-7368-44e8-9057-c21bd2b9cd4c', | ||
instance: { | ||
title: 'title', |
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.
You can another test that verifies if the modal displays the instance title as expected from props.request.instance.title
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.
Fixed
cancelRequestDialogClose: 'cancelRequestDialogClose', | ||
}; | ||
|
||
describe('CancelRequestDialog', () => { |
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.
add test to assert
- if Select component is rendered.
- if 'Confirm' button is disabled after clicking it and the modal is closed after a while?
- if TextArea component with label 'Additional information for patron' is 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.
Fixed 1 and 3
src/CancelRequestDialog.test.js
Outdated
const cancellationReasons = { | ||
records: [{ | ||
name: 'cancellation reasons', | ||
requiresAdditionalInformation: false, | ||
}, { | ||
name: 'other cancellation reasons', | ||
requiresAdditionalInformation: true, |
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.
Could you add tests to assert if additional information placeholder is displayed based on "cancellationReasons"?
c346183
to
7acd77d
Compare
7acd77d
to
9cb9c25
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Purpose
UI tests replacement with RTL/Jest for CancelRequestDialog.js
Refs
https://issues.folio.org/browse/UIREQ-876