From e4f4cc4a3228eb8c62a903af33d6f34cc48ef51d Mon Sep 17 00:00:00 2001
From: Seyaji <67058118+Seyaji@users.noreply.github.com>
Date: Mon, 20 Jun 2022 13:42:56 +0100
Subject: [PATCH] Chore: Convert pageActionBar test to RTL (#51073)
* Convert pageActionBar test to RTL
* add test for conditional render of button
---
.betterer.results | 3 ---
.../PageActionBar/PageActionBar.test.tsx | 15 ++++++++----
.../__snapshots__/PageActionBar.test.tsx.snap | 23 -------------------
3 files changed, 11 insertions(+), 30 deletions(-)
delete mode 100644 public/app/core/components/PageActionBar/__snapshots__/PageActionBar.test.tsx.snap
diff --git a/.betterer.results b/.betterer.results
index d915d1eeae9..eb57573c522 100644
--- a/.betterer.results
+++ b/.betterer.results
@@ -92,9 +92,6 @@ exports[`no enzyme tests`] = {
"packages/jaeger-ui-components/src/TraceTimelineViewer/index.test.js:276996587": [
[14, 19, 13, "RegExp match", "2409514259"]
],
- "public/app/core/components/PageActionBar/PageActionBar.test.tsx:1251504193": [
- [0, 19, 13, "RegExp match", "2409514259"]
- ],
"public/app/core/components/QueryOperationRow/QueryOperationAction.test.tsx:3032694716": [
[0, 19, 13, "RegExp match", "2409514259"]
],
diff --git a/public/app/core/components/PageActionBar/PageActionBar.test.tsx b/public/app/core/components/PageActionBar/PageActionBar.test.tsx
index 9e68addc3a2..8f27bcb8de9 100644
--- a/public/app/core/components/PageActionBar/PageActionBar.test.tsx
+++ b/public/app/core/components/PageActionBar/PageActionBar.test.tsx
@@ -1,4 +1,4 @@
-import { shallow } from 'enzyme';
+import { render, screen } from '@testing-library/react';
import React from 'react';
import PageActionBar, { Props } from './PageActionBar';
@@ -13,13 +13,20 @@ const setup = (propOverrides?: object) => {
Object.assign(props, propOverrides);
- return shallow(