From 750074fa6e44265ba7f5e6c50265b4ef37e19d9b Mon Sep 17 00:00:00 2001 From: Cody Leff Date: Mon, 23 Jan 2023 11:45:45 -0700 Subject: [PATCH] Fix test. --- .../src/components/Form/LabeledErrorBoundInput.test.jsx | 4 ++-- .../src/components/Form/LabeledErrorBoundInput.tsx | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/superset-frontend/src/components/Form/LabeledErrorBoundInput.test.jsx b/superset-frontend/src/components/Form/LabeledErrorBoundInput.test.jsx index 1202e31a1e382..a5cb80de2ff1a 100644 --- a/superset-frontend/src/components/Form/LabeledErrorBoundInput.test.jsx +++ b/superset-frontend/src/components/Form/LabeledErrorBoundInput.test.jsx @@ -81,13 +81,13 @@ describe('LabeledErrorBoundInput', () => { defaultProps.visibilityToggle = true; render(); - expect(await screen.findByRole('img', { name: /eye/i })).toBeVisible(); + expect(await screen.findByTestId('icon-eye')).toBeVisible(); }); it('becomes a password input if props.name === password (backwards compatibility)', async () => { defaultProps.name = 'password'; render(); - expect(await screen.findByRole('img', { name: /eye/i })).toBeVisible(); + expect(await screen.findByTestId('icon-eye')).toBeVisible(); }); }); diff --git a/superset-frontend/src/components/Form/LabeledErrorBoundInput.tsx b/superset-frontend/src/components/Form/LabeledErrorBoundInput.tsx index 4d4eeb194f222..51cf104b271ca 100644 --- a/superset-frontend/src/components/Form/LabeledErrorBoundInput.tsx +++ b/superset-frontend/src/components/Form/LabeledErrorBoundInput.tsx @@ -138,7 +138,11 @@ const LabeledErrorBoundInput = ({ ) : ( - + ) }