This is an automated email from the ASF dual-hosted git repository.
rusackas pushed a commit to branch scarf-pixel
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/scarf-pixel by this push:
new fd0dfbe098 fixing RTL tests
fd0dfbe098 is described below
commit fd0dfbe098aea2b8e6f5a9ee4839ec0eeefc6785
Author: Evan Rusackas <[email protected]>
AuthorDate: Mon Nov 27 14:05:39 2023 -0700
fixing RTL tests
---
.../src/components/TelemetryPixel/TelemetryPixel.test.tsx | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git
a/superset-frontend/src/components/TelemetryPixel/TelemetryPixel.test.tsx
b/superset-frontend/src/components/TelemetryPixel/TelemetryPixel.test.tsx
index 96445624c1..576c5c22da 100644
--- a/superset-frontend/src/components/TelemetryPixel/TelemetryPixel.test.tsx
+++ b/superset-frontend/src/components/TelemetryPixel/TelemetryPixel.test.tsx
@@ -17,7 +17,7 @@
* under the License.
*/
import React from 'react';
-import { render, screen } from 'spec/helpers/testing-library';
+import { render } from 'spec/helpers/testing-library';
import { FeatureFlag } from '@superset-ui/core';
import TelemetryPixel from '.';
@@ -31,7 +31,9 @@ test('should render the pixel link when FF is on', () => {
[FeatureFlag.ENABLE_TELEMETRY]: true,
};
render(<TelemetryPixel />);
- expect(screen.getByText('scarf.sh')).toBeInTheDocument();
+
+ const image = document.querySelector('img[src*="scarf.sh"]');
+ expect(image).toBeInTheDocument();
});
test('should NOT render the pixel link when FF is off', () => {
@@ -39,5 +41,7 @@ test('should NOT render the pixel link when FF is off', () =>
{
[FeatureFlag.ENABLE_TELEMETRY]: false,
};
render(<TelemetryPixel />);
- expect(screen.getByText('scarf.sh')).not.toBeInTheDocument();
+
+ const image = document.querySelector('img[src*="scarf.sh"]');
+ expect(image).not.toBeInTheDocument();
});