Skip to content

chore: update unit test coverage to 100% on util files #2139

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

Merged
merged 18 commits into from
Apr 13, 2023

Conversation

Golodhros
Copy link
Member

Description

Adds tests to cover all the util codes in the frontend
Refactors tests and file names

Motivation and Context

Increasing test coverage

How Has This Been Tested?

Ran tests

-bash

CheckList

  • PR title addresses the issue accurately and concisely
  • Updates Documentation and Docstrings
  • Adds tests
  • Adds instrumentation (logs, or UI events)

Signed-off-by: Marcos Iglesias <[email protected]>
@boring-cyborg boring-cyborg bot added the area:frontend From the Frontend folder label Apr 12, 2023
Copy link
Member

@feng-tao feng-tao left a comment

Choose a reason for hiding this comment

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

always great to see unit test coverage goes up!

Comment on lines 59 to 65
const expected = undefined;
const actual = TextUtils.convertText(
expected,
TextUtils.CaseType.TITLE_CASE
);

expect(actual).toEqual('');
Copy link
Contributor

Choose a reason for hiding this comment

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

nit suggestion for readability so the expected value is equal to the result

Suggested change
const expected = undefined;
const actual = TextUtils.convertText(
expected,
TextUtils.CaseType.TITLE_CASE
);
expect(actual).toEqual('');
const expected = '';
const actual = TextUtils.convertText(
undefined,
TextUtils.CaseType.TITLE_CASE
);
expect(actual).toEqual(expected);

Copy link
Member Author

Choose a reason for hiding this comment

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

Good call! A copy/paste error.
Changing it

Signed-off-by: Marcos Iglesias <[email protected]>
@Golodhros Golodhros merged commit a99fc0d into main Apr 13, 2023
@Golodhros Golodhros deleted the chore-mi-utils-coverage branch April 13, 2023 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:frontend From the Frontend folder
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants