diff --git a/.betterer.results b/.betterer.results
index 99f04a4c775..f4f32c06177 100644
--- a/.betterer.results
+++ b/.betterer.results
@@ -98,9 +98,6 @@ exports[`no enzyme tests`] = {
"packages/jaeger-ui-components/src/TraceTimelineViewer/index.test.js:381298544": [
[14, 19, 13, "RegExp match", "2409514259"]
],
- "packages/jaeger-ui-components/src/common/NewWindowIcon.test.js:1750458349": [
- [14, 19, 13, "RegExp match", "2409514259"]
- ],
"packages/jaeger-ui-components/src/common/UiFindInput.test.js:2207118020": [
[14, 19, 13, "RegExp match", "2409514259"]
],
diff --git a/packages/jaeger-ui-components/package.json b/packages/jaeger-ui-components/package.json
index bd6dfb630ee..6bb1d0e1d8b 100644
--- a/packages/jaeger-ui-components/package.json
+++ b/packages/jaeger-ui-components/package.json
@@ -10,17 +10,20 @@
},
"devDependencies": {
"@grafana/tsconfig": "^1.2.0-rc1",
+ "@testing-library/jest-dom": "5.16.4",
"@testing-library/react": "12.1.4",
"@testing-library/user-event": "14.2.0",
"@types/classnames": "^2.2.7",
"@types/deep-freeze": "^0.1.1",
"@types/grafana__slate-react": "npm:@types/slate-react@0.22.5",
"@types/hoist-non-react-statics": "^3.3.1",
+ "@types/jest": "27.5.1",
"@types/lodash": "4.14.182",
"@types/prop-types": "15.7.5",
"@types/react": "17.0.42",
"@types/react-icons": "2.2.7",
"@types/reselect": "2.2.0",
+ "@types/testing-library__jest-dom": "5.14.3",
"@types/tinycolor2": "1.4.3",
"enzyme": "3.11.0",
"sinon": "14.0.0",
diff --git a/packages/jaeger-ui-components/src/common/NewWindowIcon.test.js b/packages/jaeger-ui-components/src/common/NewWindowIcon.test.tsx
similarity index 65%
rename from packages/jaeger-ui-components/src/common/NewWindowIcon.test.js
rename to packages/jaeger-ui-components/src/common/NewWindowIcon.test.tsx
index 160d4c2b0bd..bde47016e78 100644
--- a/packages/jaeger-ui-components/src/common/NewWindowIcon.test.js
+++ b/packages/jaeger-ui-components/src/common/NewWindowIcon.test.tsx
@@ -12,29 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-import { shallow } from 'enzyme';
+import { render } from '@testing-library/react';
import React from 'react';
import NewWindowIcon, { getStyles } from './NewWindowIcon';
describe('NewWindowIcon', () => {
- const props = {
- notIsLarge: 'not is large',
- };
- let wrapper;
-
- beforeEach(() => {
- wrapper = shallow();
- });
-
- it('renders as expected', () => {
- expect(wrapper).toMatchSnapshot();
- });
-
it('adds is-large className when props.isLarge is true', () => {
+ const { container } = render();
const styles = getStyles();
- expect(wrapper.hasClass(styles.NewWindowIconLarge)).toBe(false);
- wrapper.setProps({ isLarge: true });
- expect(wrapper.hasClass(styles.NewWindowIconLarge)).toBe(true);
+ expect(container.firstChild).toHaveClass(styles.NewWindowIconLarge);
});
});
diff --git a/packages/jaeger-ui-components/src/common/__snapshots__/NewWindowIcon.test.js.snap b/packages/jaeger-ui-components/src/common/__snapshots__/NewWindowIcon.test.js.snap
deleted file mode 100644
index 7ef1f60f17e..00000000000
--- a/packages/jaeger-ui-components/src/common/__snapshots__/NewWindowIcon.test.js.snap
+++ /dev/null
@@ -1,8 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`NewWindowIcon renders as expected 1`] = `
-
-`;
diff --git a/yarn.lock b/yarn.lock
index 26dbd7ab2b4..8277eaf63d2 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -4577,17 +4577,20 @@ __metadata:
"@grafana/e2e-selectors": 9.0.0-pre
"@grafana/tsconfig": ^1.2.0-rc1
"@grafana/ui": 9.0.0-pre
+ "@testing-library/jest-dom": 5.16.4
"@testing-library/react": 12.1.4
"@testing-library/user-event": 14.2.0
"@types/classnames": ^2.2.7
"@types/deep-freeze": ^0.1.1
"@types/grafana__slate-react": "npm:@types/slate-react@0.22.5"
"@types/hoist-non-react-statics": ^3.3.1
+ "@types/jest": 27.5.1
"@types/lodash": 4.14.182
"@types/prop-types": 15.7.5
"@types/react": 17.0.42
"@types/react-icons": 2.2.7
"@types/reselect": 2.2.0
+ "@types/testing-library__jest-dom": 5.14.3
"@types/tinycolor2": 1.4.3
chance: ^1.0.10
classnames: ^2.2.5