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

Update Bar unit tests to use Jest #324

Merged
merged 24 commits into from
Jan 8, 2024
Merged

Update Bar unit tests to use Jest #324

merged 24 commits into from
Jan 8, 2024

Conversation

sdadn
Copy link
Contributor

@sdadn sdadn commented Jan 8, 2024

Summary

This PR updates the repo to utilize Jest for unit tests instead of Karma. Since there are a large amount of tests to go over, this PR narrows the scope to only the Bar graph. Other graph types and unit tests will be updated in subsequent PRs.

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

The CICD was switched over to utilize Jest and it is currently passing:

CleanShot 2024-01-08 at 13 25 39

CleanShot 2024-01-08 at 13 25 47

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

@sdadn sdadn self-assigned this Jan 8, 2024
@sdadn sdadn marked this pull request as ready for review January 8, 2024 19:27
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.

Some typos and minor questions, otherwise working as expected, hence approving
Screenshot 2024-01-08 at 3 04 25 PM

jest.config.js Outdated Show resolved Hide resolved
packages/carbon-graphs/jest.config.js Outdated Show resolved Hide resolved
Co-authored-by: Alla Doroshkevych <[email protected]>
Copy link

@kenk2 kenk2 left a comment

Choose a reason for hiding this comment

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

Just questions or nits, shall approve upon addressing.

@@ -87,7 +87,7 @@ describe('Bar - Panning', () => {

expect(() => { graphDefault.reflow(panData); }).toThrowError(errors.THROW_MSG_INVALID_DATA);
});
it('throws error when undefined value is passed as y', () => {
it('throws aan error when y is passed as undefined', () => {
Copy link

Choose a reason for hiding this comment

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

spelling nit: aan -> an

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe this got updated in: 6cf7494

];

const plugins = [
'@babel/plugin-proposal-object-rest-spread',
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.

Maybe not in this PR but I believe this is the deprecated version of this plugin. If you're continuing work on this it might be a good idea to use @babel/plugin-transform-object-rest-spread like we're doing here with the other babel plugins.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for pointing that out! I'll make that change in the next PR.

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