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

UIREQ-876: UI tests replacement with RTL/Jest for CancelRequestDialog.js #1069

Merged
merged 2 commits into from
Jul 11, 2023

Conversation

Dmitriy-Litvinenko
Copy link
Contributor

Purpose

UI tests replacement with RTL/Jest for CancelRequestDialog.js

Refs

https://issues.folio.org/browse/UIREQ-876

@Dmitriy-Litvinenko Dmitriy-Litvinenko requested review from artem-blazhko and a team June 27, 2023 18:06
@github-actions
Copy link

github-actions bot commented Jun 27, 2023

Jest Unit Test Statistics

    1 files  ±  0    37 suites  +1   1m 3s ⏱️ -1s
347 tests +11  347 ✔️ +11  0 💤 ±0  0 ±0 
348 runs  +11  348 ✔️ +11  0 💤 ±0  0 ±0 

Results for commit 9cb9c25. ± Comparison against base commit 54c04a5.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Jun 27, 2023

BigTest Unit Test Statistics

134 tests  ±0   134 ✔️ ±0   14s ⏱️ -1s
    1 suites ±0       0 💤 ±0 
    1 files   ±0       0 ±0 

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.
Chrome_114_0_0_0_(Linux_x86_64).View request page ‑ View request page View default request Request cancelation clicking the Actions menu on the Requests pane Export hold shelf clearance report button should be disabled
Chrome_114_0_0_0_(Linux_x86_64).View request page ‑ View request page View default request Request cancelation closes request view
Chrome_114_0_0_0_(Linux_x86_64).View request page ‑ View request page View default request Request cancelation confirm cancel request Export hold shelf clearance report button should be enabled
Chrome_114_0_0_0_(Linux_x86_64).View request page ‑ View request page View default request Request cancelation confirm cancel request closes request view
Chrome_114_0_0_0_(Linux_x86_64).View request page ‑ View request page View default request Request cancellation clicking the Actions menu on the Requests pane Export hold shelf clearance report button should be disabled
Chrome_114_0_0_0_(Linux_x86_64).View request page ‑ View request page View default request Request cancellation closes request view
Chrome_114_0_0_0_(Linux_x86_64).View request page ‑ View request page View default request Request cancellation confirm cancel request Export hold shelf clearance report button should be enabled
Chrome_114_0_0_0_(Linux_x86_64).View request page ‑ View request page View default request Request cancellation confirm cancel request closes request view

♻️ This comment has been updated with latest results.

request: {
id: 'ad038163-7368-44e8-9057-c21bd2b9cd4c',
instance: {
title: 'title',
Copy link
Contributor

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

Copy link
Contributor Author

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add test to assert

  1. if Select component is rendered.
  2. if 'Confirm' button is disabled after clicking it and the modal is closed after a while?
  3. if TextArea component with label 'Additional information for patron' is 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.

Fixed 1 and 3

Comment on lines 26 to 36
const cancellationReasons = {
records: [{
name: 'cancellation reasons',
requiresAdditionalInformation: false,
}, {
name: 'other cancellation reasons',
requiresAdditionalInformation: true,
Copy link
Contributor

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"?

@Dmitriy-Litvinenko Dmitriy-Litvinenko changed the title UI tests replacement with RTL/Jest for CancelRequestDialog.js UIREQ-876: UI tests replacement with RTL/Jest for CancelRequestDialog.js Jul 6, 2023
@sonarcloud
Copy link

sonarcloud bot commented Jul 11, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@Dmitriy-Litvinenko Dmitriy-Litvinenko merged commit acabd10 into master Jul 11, 2023
5 checks passed
@Dmitriy-Litvinenko Dmitriy-Litvinenko deleted the UIREQ-876 branch July 11, 2023 11:26
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.

4 participants