Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

Update Pie & Carbon API tests to use Jest #325

Merged
merged 7 commits into from
Jan 9, 2024
Merged

Conversation

sdadn
Copy link
Contributor

@sdadn sdadn commented Jan 8, 2024

Summary

This PR continues the work started in #324 to utilize Jest for unit tests instead of Karma.

This PR makes the following changes:

  • update Carbon API tests to work with Jest.
  • Update Pie chart tests to work with Jest.
  • Replace the deprecated @babel/plugin-proposal-object-rest-spread with @babel/plugin-transform-object-rest-spread.

Note: A small subset of tests are failing due to differing values or due to an undefined value in the graph API. These tests are being skipped for now as they require dedicated debugging and the current objective is to switch over to Jest for unit tests. These failing tests will be fixed in a separate Jira.

Testing

This change was tested using:

  • WDIO
  • Jest
  • Visual testing (please attach a screenshot or recording)
  • Other (please describe below)
  • No tests are needed

Reviews

In addition to engineering reviews, this PR needs:

  • UX review
  • Accessibility review
  • Functional review

Additional Details

This PR resolves:

UXPLATFORM-9813


Thank you for contributing to Terra.
@cerner/terra

"@babel/runtime": "^7.10.4",
"@babel/cli": "^7",
"@babel/core": "7",
"@babel/plugin-transform-object-assign": "7",
Copy link

@kenk2 kenk2 Jan 8, 2024

Choose a reason for hiding this comment

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

Question: Any reason why we're fixing these packages to a specific version instead of the carat notation? Unless I'm mistaken won't this actually be a downgrade (because we're fixing to a specific version in this case)?

Also I feel that we should probably keep the semver fully specified so that we know where our last working version is in case any upstream shenanigans (like babel stuff) happens and we need a reference point to easily downgrade to.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These aren't locking packages, it is just the shorter form of using the caret. We don't typically keep track of the minor versions of dev dependencies so this is just makes it clearer that we're using the "latest minor version of v7", especially with related dependencies that need to be on the same major version. It also makes future updates easier by needing to simply change the number.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

With caret:
CleanShot 2024-01-08 at 17 04 16

With only major version:
CleanShot 2024-01-08 at 17 04 03

Copy link
Contributor

@adoroshk adoroshk left a comment

Choose a reason for hiding this comment

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

Works as expected, no problem other than lint-related.

Screenshot 2024-01-09 at 9 24 51 AM

@github-actions github-actions bot temporarily deployed to preview-pr-325 January 9, 2024 15:00 Destroyed
@sdadn sdadn merged commit 806c18c into main Jan 9, 2024
10 checks passed
@sdadn sdadn deleted the update-carbon-jest-tests branch January 9, 2024 15:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants