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

Remove dependency on enzyme #1668

Open
Tracked by #1199
yurishkuro opened this issue Aug 12, 2023 · 14 comments
Open
Tracked by #1199

Remove dependency on enzyme #1668

yurishkuro opened this issue Aug 12, 2023 · 14 comments

Comments

@yurishkuro
Copy link
Member

yurishkuro commented Aug 12, 2023

Enzyme is not compatible with React 18, so we need to phase it out.

Preferred approach is to migrate to react-testing-library. In some cases we may use a replacement shallow function #1653, but only when absolutely necessary, it's better to move away from snapshot testing.

For examples of this being partially done, see merged PRs in this ticket below (e.g. #1659 #1653 #1643).

The scope of this is sizeable, so the recommendation is to limit the changes to specific modules, a couple test files at a time.

Current enzyme references (Nov 9):

$ grep -rn enzyme packages/jaeger-ui/src
packages/jaeger-ui/src/utils/redux-form-field-adapter.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/Monitor/index.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/Monitor/EmptyState/index.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/Monitor/ServicesView/index.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/Monitor/ServicesView/serviceGraph.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/Monitor/ServicesView/operationDetailsTable/index.test.js:16:import { mount, shallow } from 'enzyme';
packages/jaeger-ui/src/components/Monitor/ServicesView/operationDetailsTable/opsGraph.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/QualityMetrics/MetricCard.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/QualityMetrics/index.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/QualityMetrics/Header.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/common/SearchableSelect.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/common/CircularProgressbar.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/common/TraceName.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/common/EmphasizedNode.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/common/DetailsCard/DetailList.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/common/DetailsCard/index.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/common/DetailsCard/DetailTable.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/common/DetailsCard/DetailTableDropdown.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/common/UiFindInput.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/common/ExternalLinks.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/common/ErrorMessage.test.js:16:import { shallow, mount } from 'enzyme';
packages/jaeger-ui/src/components/common/FilteredList/highlightMatches.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/common/FilteredList/ListItem.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/common/FilteredList/index.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/common/VerticalResizer.test.js:16:import { mount } from 'enzyme';
packages/jaeger-ui/src/components/common/ExamplesLink.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/common/CopyIcon.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/common/NameSelector.test.js:18:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/DeepDependencies/SidePanel/DetailsPanel.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/DeepDependencies/SidePanel/index.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/DeepDependencies/Graph/DdgNodeContent/index.test.js:24:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/DeepDependencies/Graph/getNodeRenderers.test.js:15:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/DeepDependencies/Graph/index.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/DeepDependencies/index.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/DeepDependencies/traces.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/DeepDependencies/Header/ChevronDown.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/DeepDependencies/Header/LayoutSettings/index.test.js:17:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/DeepDependencies/Header/index.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/DeepDependencies/Header/HopsSelector/Selector.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/DeepDependencies/Header/HopsSelector/index.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/TraceDiff/TraceDiffGraph/renderNode.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/TraceDiff/TraceDiffGraph/TraceDiffGraph.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/TraceDiff/TraceDiffHeader/TraceHeader.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/TraceDiff/TraceDiffHeader/TraceDiffHeader.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/TraceDiff/TraceDiffHeader/TraceIdInput.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/TraceDiff/TraceDiffHeader/CohortTable.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/TraceDiff/TraceDiffHeader/CohortTable.test.js:62:   * when props change because enzyme does not support wrapper.setProps for classes that render an array of
packages/jaeger-ui/src/components/TraceDiff/TraceDiffHeader/CohortTable.test.js:155:      // traceNameRenderer returns a React Fragment, wrapper div helps enzyme
packages/jaeger-ui/src/components/TraceDiff/TraceDiffHeader/CohortTable.test.js:178:      // traceNameRenderer returns a React Fragment, wrapper div helps enzyme
packages/jaeger-ui/src/components/TraceDiff/TraceDiff.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/DependencyGraph/DependencyForceGraph.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/DependencyGraph/ForceGraphArrowLink.test.js:22:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/DependencyGraph/index.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/TracePage/TraceSpanView/index.test.js:16:import { mount, shallow } from 'enzyme';
packages/jaeger-ui/src/components/TracePage/url/ReferenceLink.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/TracePage/index.test.js:32:import { shallow, mount } from 'enzyme';
packages/jaeger-ui/src/components/TracePage/TracePageHeader/KeyboardShortcutsHelp.test.js:17:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/TracePage/TracePageHeader/AltViewOptions.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/TracePage/TracePageHeader/TracePageHeader.test.js:16:import { shallow, mount } from 'enzyme';
packages/jaeger-ui/src/components/TracePage/TracePageHeader/SpanGraph/CanvasSpanGraph.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/TracePage/TracePageHeader/SpanGraph/TickLabels.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/TracePage/TracePageHeader/SpanGraph/ViewingLayer.test.js:15:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/TracePage/TracePageHeader/SpanGraph/Scrubber.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/TracePage/TracePageHeader/SpanGraph/index.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/TracePage/TracePageHeader/SpanGraph/GraphTicks.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/TracePage/TracePageHeader/TracePageSearchBar.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/TracePage/TraceFlamegraph/index.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/TracePage/TraceGraph/TraceGraph.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/TracePage/TraceGraph/OpNode.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/TracePage/ArchiveNotifier/index.test.js:16:import { mount, shallow } from 'enzyme';
packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/SpanBarRow.test.js:16:import { mount, shallow } from 'enzyme';
packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/SpanTreeOffset.test.js:15:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/ReferencesButton.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/SpanDetailRow.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/ListView/index.test.js:16:import { mount, shallow } from 'enzyme';
packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/index.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/SpanDetail/AccordianKeyValues.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/SpanDetail/TextList.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/SpanDetail/index.test.js:19:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/SpanDetail/AccordianText.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/SpanDetail/AccordianLogs.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/SpanDetail/AccordianReferences.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/SpanDetail/KeyValuesTable.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/VirtualizedTraceView.test.js:15:import { shallow, mount } from 'enzyme';
packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/Ticks.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/TimelineHeaderRow/TimelineViewingLayer.test.js:16:import { mount } from 'enzyme';
packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/TimelineHeaderRow/TimelineCollapser.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/TimelineHeaderRow/TimelineHeaderRow.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/TracePage/TraceStatistics/index.test.js:16:import { mount } from 'enzyme';
packages/jaeger-ui/src/components/TracePage/TraceStatistics/PopupSql.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/SearchTracePage/SearchResults/DiffSelection.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/SearchTracePage/SearchResults/AltViewOptions.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/SearchTracePage/SearchResults/index.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/SearchTracePage/SearchResults/DownloadResults.test.js:17:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/SearchTracePage/SearchResults/ResultItem.test.js:17:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/SearchTracePage/SearchResults/ScatterPlot.test.js:16:import { mount, shallow } from 'enzyme';
packages/jaeger-ui/src/components/SearchTracePage/SearchResults/ResultItemTitle.test.js:17:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/SearchTracePage/FileLoader.test.js:16:import { shallow } from 'enzyme';
packages/jaeger-ui/src/components/SearchTracePage/index.test.js:32:import { mount } from 'enzyme';
packages/jaeger-ui/src/components/SearchTracePage/SearchForm.test.js:19:import { shallow } from 'enzyme';
@Sangam-ghimire
Copy link

I want to work on this @yurishkuro. Can you assign it to me please? Will be a very good start for me

@yurishkuro
Copy link
Member Author

We do not assign issues. There are multiple packages that are affected, don't try to change all in one PR.

@Sangam-ghimire
Copy link

@yurishkuro Any previous discussion that I should not miss, execpt the mentioned ones.

@AbhishekTiwari23
Copy link

I also want to work on this. There are several test files, so I think we can split the task between us, @Sangam-ghimire. Please let me know if you want to handle all the files alone because if we both work on same files, it will waste time for both of us.
Thanks

@Sangam-ghimire
Copy link

Sure @AbhishekTiwari23 that's a great spirit. Let's split and work together. I might need some help too.

@anshgoyalevil
Copy link
Contributor

@Sangam-ghimire @AbhishekTiwari23 Please have a look at the discussion among the PRs: #1659 #1653 #1643
It would help you understand the issue's landscape.

@AbhishekTiwari23
Copy link

Thanks, working on it

yurishkuro pushed a commit that referenced this issue Aug 16, 2023
## Which problem is this PR solving?  
- part of #1668 
- migrating the existing Enzyme based tests to React Testing Libary

## Description of the changes
Currently I migrated 3 files 
- `QualityMetrics/BannerText.test.js`
- `QualityMetrics/CountCard.test.js`

## How was this change tested?
- replaced the shallow module from enzyme to render from RTL

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

---------

Signed-off-by: Freedisch <freeproduc@gmail.com>
Signed-off-by: Freedisch <freeproduc@gamil.com>
Co-authored-by: Freedisch <freeproduc@gamil.com>
yurishkuro pushed a commit that referenced this issue Aug 16, 2023
## Which problem is this PR solving?
- This PR migrates the `TraceIDSearchInput.test.js` from Enzyme to RTL
- Snapshot testing is replaced with specific expect statement
- Part of: #1668

## How was this change tested?
- Using yarn lint && yarn test-ci TraceIDSearchInput --coverage

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

---------

Signed-off-by: Ansh Goyal <anshgoyal1704@gmail.com>
yurishkuro pushed a commit that referenced this issue Aug 17, 2023
## Which problem is this PR solving?
- This PR migrates the `DAG.test.js` from Enzyme to RTL
- part of: #1668

## How was this change tested?
- Using `yarn test-ci`

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

Signed-off-by: Ansh Goyal <anshgoyal1704@gmail.com>
yurishkuro pushed a commit that referenced this issue Aug 18, 2023
## Which problem is this PR solving?
- This PR Migrates `SpanBar.test.js` from Enzyme to RTL
- part of: #1668

## How was this change tested?
- using `yarn test-ci`

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

---------

Signed-off-by: Ansh Goyal <anshgoyal1704@gmail.com>
yurishkuro pushed a commit that referenced this issue Aug 20, 2023
## Which problem is this PR solving?
- This PR migrates the test `NewWindowIcon.test.js` from Enzyme to RTL
- part of: #1668

## How was this change tested?
- using `yarn test-ci`

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

---------

Signed-off-by: Ansh Goyal <anshgoyal1704@gmail.com>
@anikdhabal
Copy link
Contributor

anikdhabal commented Aug 27, 2023

Thanks, working on it

Have you started?

@suhail34
Copy link
Contributor

@suhail34
Copy link
Contributor

Now i am thinking to work on components/DeepDependencies

yurishkuro added a commit that referenced this issue Oct 16, 2023
## Which problem is this PR solving?
- Part of #1668
- Using React Testing Library to remove dependency on enzyme for
index.test.js and TopNav.test.js

## How was this change tested?
- Tested my changes inside packages/jaeger-ui/ using command `npx jest
--testPathPattern=src/components/App/.*\.test\.js`
- Also performed yarn test

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

---------

Signed-off-by: suhail34 <suhailkna@gmail.com>
Signed-off-by: Yuri Shkuro <github@ysh.us>
Co-authored-by: Yuri Shkuro <github@ysh.us>
yurishkuro added a commit that referenced this issue Nov 10, 2023
## Which problem is this PR solving?
Fixes part of #1668 

## Description of the changes
Migrated the `TraceTimelineLink.test.js` to `RTL` using the idiomatic
RTL practices

## How was this change tested?
Ran the test suite to ensure all changes passed.

## Checklist
- [X] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [X] I have signed all commits
- [X] I have added unit tests for the new functionality
- [X] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

---------

Signed-off-by: Eshaan Aggarwal <96648934+EshaanAgg@users.noreply.github.com>
Signed-off-by: Yuri Shkuro <github@ysh.us>
Co-authored-by: Yuri Shkuro <github@ysh.us>
yurishkuro pushed a commit that referenced this issue Nov 10, 2023
## Which problem is this PR solving?
Fixes part of #1668 

## Description of the changes
Migrated one component to RTL

## How was this change tested?
Ran the test suite and ensured all of them pass

## Checklist
- [X] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [X] I have signed all commits
- [X] I have added unit tests for the new functionality
- [X] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

---------

Signed-off-by: Eshaan Aggarwal <96648934+EshaanAgg@users.noreply.github.com>
@EshaanAgg
Copy link
Contributor

EshaanAgg commented Nov 10, 2023

Hi! I have been migrating some files to RTL, and one common pattern that I keep stumbling upon is using snapshots in testing. Have any tests been migrated from enzyme to RTL containing snapshots, or should I research the same and propose a way forward?

The reason I'm saying this is due to the bulky snapshots generated by RTL and the fact that it is built to test for user interactions, and not necessarily the rendered DOM.

cc: @anshgoyalevil @yurishkuro

@yurishkuro
Copy link
Member Author

yurishkuro commented Nov 10, 2023

@EshaanAgg in many cases snapshot testing is just lazy tests. Ideally we want to move away from those to more explicit tests like the two you fixed today. But we do have a shortcut that still allows to use snapshots without enzyme, as in #1653.

yurishkuro pushed a commit that referenced this issue Nov 10, 2023
## Which problem is this PR solving?
Fixes part of #1668 

## Description of the changes
Migrates the test for `ChevronDown.tsx` to RTL

## How was this change tested?
Ran the test suite locally

## Checklist
- [X] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [X] I have signed all commits
- [X] I have added unit tests for the new functionality
- [X] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

Signed-off-by: Eshaan Aggarwal <96648934+EshaanAgg@users.noreply.github.com>
@EshaanAgg
Copy link
Contributor

EshaanAgg commented Nov 10, 2023

Ahh, I got it. I'll try to experiment with the tests and see if we can move away from them in some components.

EshaanAgg added a commit to EshaanAgg/jaeger-ui that referenced this issue Nov 11, 2023
## Which problem is this PR solving?
Fixes part of jaegertracing#1668

## Description of the changes
Migrates the test for `ChevronDown.tsx` to RTL

## How was this change tested?
Ran the test suite locally

## Checklist
- [X] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [X] I have signed all commits
- [X] I have added unit tests for the new functionality
- [X] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

Signed-off-by: Eshaan Aggarwal <96648934+EshaanAgg@users.noreply.github.com>
yurishkuro added a commit that referenced this issue Nov 12, 2023
## Which problem is this PR solving?
Fixes part of #1668 

## Description of the changes
Migrates `TraceHeader.tsx` from enzyme to RTL. Removes the snapshot
tests to relevant assertions with the help of `test-ids`.

## How was this change tested?
Running the test suite locally. 

## Checklist
- [X] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [X] I have signed all commits
- [X] I have added unit tests for the new functionality
- [X] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

---------

Signed-off-by: Eshaan Aggarwal <96648934+EshaanAgg@users.noreply.github.com>
Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
yurishkuro pushed a commit that referenced this issue Dec 24, 2023
…zyme to RTL (#2066)

## Which problem is this PR solving?
Fixes part of #1668 

## Description of the changes
- Migrates `ExamplesLink` and `EmphasizedNode` components from enzyme to
RTL
- Replaces snapshot testing with actual test for the URLs

## How was this change tested?
Running the tests locally

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

Signed-off-by: Eshaan Aggarwal <96648934+EshaanAgg@users.noreply.github.com>
yurishkuro pushed a commit that referenced this issue Dec 24, 2023
## Which problem is this PR solving?
Fixes part of #1668 

## Description of the changes
Migrate `ExternalLinks` component from enzyme to RTL

## How was this change tested?
Ran the tests locally

## Checklist
- [X] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [X] I have signed all commits
- [X] I have added unit tests for the new functionality
- [X] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

Signed-off-by: Eshaan Aggarwal <96648934+EshaanAgg@users.noreply.github.com>
yurishkuro pushed a commit that referenced this issue Dec 25, 2023
## Which problem is this PR solving?
Fixes part of #1668 

## Description of the changes
Migrates the following components from Enzyme to RTL
1. `CircularProgressbar`
2. `ErrorMessage`
3. `TraceName`

- Removed the instances of snapshot testing from the same and migrated
to tests checking the functionality associated with them
- Refactored some of the original code of the components to make them
more readable

## How was this change tested?
- Running the tests locally

## Checklist
- [X] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [X] I have signed all commits
- [X] I have added unit tests for the new functionality
- [X] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

---------

Signed-off-by: Eshaan Aggarwal <96648934+EshaanAgg@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants