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

Improved SearchForm test suite #688

Merged
merged 5 commits into from
Feb 19, 2021
Merged

Conversation

achesin
Copy link
Contributor

@achesin achesin commented Feb 16, 2021

Signed-off-by: Amanda Chesin Amanda.Chesin1@aexp.com

Which problem is this PR solving?

  • Adding test coverage around existing functionality.

Short description of the changes

  • Added new tests for SearchForm, including coverage for mapDispatchToProps, the operation dropdown, etc.

Signed-off-by: Amanda Chesin <Amanda.Chesin1@aexp.com>
@codecov
Copy link

codecov bot commented Feb 16, 2021

Codecov Report

Merging #688 (300d200) into master (abdf99d) will increase coverage by 0.03%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #688      +/-   ##
==========================================
+ Coverage   94.36%   94.39%   +0.03%     
==========================================
  Files         230      230              
  Lines        5959     5959              
  Branches     1448     1448              
==========================================
+ Hits         5623     5625       +2     
+ Misses        302      300       -2     
  Partials       34       34              
Impacted Files Coverage Δ
...er-ui/src/components/SearchTracePage/SearchForm.js 90.75% <ø> (+1.68%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update abdf99d...117468c. Read the comment docs.

wrapper = shallow(<SearchForm {...defaultProps} selectedService="svcB" />);
const field = wrapper.find(`Field[name="operation"]`);
expect(field).toMatchSnapshot();
});
Copy link
Member

@yurishkuro yurishkuro Feb 17, 2021

Choose a reason for hiding this comment

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

If I understand this correctly, these new tests are merely checking a single property on the field. Wouldn't it be simpler to test that single property directly, like expect(field.foo).equalTo('bar'), than to compare with a whole snapshot? The intent would be a lot more obvious and maintenance easier.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi, I reworked those tests to test the single property instead of using the snapshots. Please let me know what you think, thanks!

Copy link
Member

Choose a reason for hiding this comment

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

Thanks!

What about this specific test? Is it aiming to check only the boolean condition, or also the list of operations that are included in the dropdown?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, meant to remove that snapshot test in the last commit, I'm new to open source contributions so my bad!

Signed-off-by: Amanda Chesin <Amanda.Chesin1@aexp.com>
Signed-off-by: Amanda Chesin <Amanda.Chesin1@aexp.com>
Copy link
Member

@yurishkuro yurishkuro left a comment

Choose a reason for hiding this comment

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

Thanks!

@yurishkuro yurishkuro merged commit 35cc879 into jaegertracing:master Feb 19, 2021
vvvprabhakar pushed a commit to vvvprabhakar/jaeger-ui that referenced this pull request Jun 23, 2021
* improved searchform test suite

Signed-off-by: Amanda Chesin <Amanda.Chesin1@aexp.com>

* improved searchform test suite, removede snapshots

Signed-off-by: Amanda Chesin <Amanda.Chesin1@aexp.com>

* removed snapshot tests

Signed-off-by: Amanda Chesin <Amanda.Chesin1@aexp.com>
Signed-off-by: vvvprabhakar <vvvprabhakar@gmail.com>
vvvprabhakar pushed a commit to vvvprabhakar/jaeger-ui that referenced this pull request Jul 4, 2021
* improved searchform test suite

Signed-off-by: Amanda Chesin <Amanda.Chesin1@aexp.com>

* improved searchform test suite, removede snapshots

Signed-off-by: Amanda Chesin <Amanda.Chesin1@aexp.com>

* removed snapshot tests

Signed-off-by: Amanda Chesin <Amanda.Chesin1@aexp.com>
Signed-off-by: vvvprabhakar <vvvprabhakar@gmail.com>
vvvprabhakar pushed a commit to vvvprabhakar/jaeger-ui that referenced this pull request Jul 4, 2021
* improved searchform test suite

Signed-off-by: Amanda Chesin <Amanda.Chesin1@aexp.com>

* improved searchform test suite, removede snapshots

Signed-off-by: Amanda Chesin <Amanda.Chesin1@aexp.com>

* removed snapshot tests

Signed-off-by: Amanda Chesin <Amanda.Chesin1@aexp.com>
Signed-off-by: vvvprabhakar <vvvprabhakar@gmail.com>
vvvprabhakar pushed a commit to vvvprabhakar/jaeger-ui that referenced this pull request Jul 4, 2021
* improved searchform test suite

Signed-off-by: Amanda Chesin <Amanda.Chesin1@aexp.com>

* improved searchform test suite, removede snapshots

Signed-off-by: Amanda Chesin <Amanda.Chesin1@aexp.com>

* removed snapshot tests

Signed-off-by: Amanda Chesin <Amanda.Chesin1@aexp.com>
Signed-off-by: vvvprabhakar <vvvprabhakar@gmail.com>
vvvprabhakar pushed a commit to vvvprabhakar/jaeger-ui that referenced this pull request Jul 5, 2021
* improved searchform test suite

Signed-off-by: Amanda Chesin <Amanda.Chesin1@aexp.com>

* improved searchform test suite, removede snapshots

Signed-off-by: Amanda Chesin <Amanda.Chesin1@aexp.com>

* removed snapshot tests

Signed-off-by: Amanda Chesin <Amanda.Chesin1@aexp.com>
Signed-off-by: vvvprabhakar <vvvprabhakar@gmail.com>
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.

None yet

2 participants