Skip to content

Commit 750074f

Browse files
committed
Fix test.
1 parent 2aaa3bc commit 750074f

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

superset-frontend/src/components/Form/LabeledErrorBoundInput.test.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,13 @@ describe('LabeledErrorBoundInput', () => {
8181
defaultProps.visibilityToggle = true;
8282
render(<LabeledErrorBoundInput {...defaultProps} />);
8383

84-
expect(await screen.findByRole('img', { name: /eye/i })).toBeVisible();
84+
expect(await screen.findByTestId('icon-eye')).toBeVisible();
8585
});
8686

8787
it('becomes a password input if props.name === password (backwards compatibility)', async () => {
8888
defaultProps.name = 'password';
8989
render(<LabeledErrorBoundInput {...defaultProps} />);
9090

91-
expect(await screen.findByRole('img', { name: /eye/i })).toBeVisible();
91+
expect(await screen.findByTestId('icon-eye')).toBeVisible();
9292
});
9393
});

superset-frontend/src/components/Form/LabeledErrorBoundInput.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,11 @@ const LabeledErrorBoundInput = ({
138138
</Tooltip>
139139
) : (
140140
<Tooltip title={t('Show password.')}>
141-
<Icons.EyeOutlined iconSize="m" css={iconReset} />
141+
<Icons.EyeOutlined
142+
iconSize="m"
143+
css={iconReset}
144+
data-test="icon-eye"
145+
/>
142146
</Tooltip>
143147
)
144148
}

0 commit comments

Comments
 (0)