Skip to content

Commit 1e21bf0

Browse files
committed
feat: state-based test id for password toggle
*-hide-icon when password is visible *-show-icon when password is hidden
1 parent c706bb1 commit 1e21bf0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/design-system/password-box/uncontrolled-password-box-input.component.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,11 @@ export const UncontrolledPasswordInput = ({
8282
{label}
8383
</Form.Label>
8484
<PasswordInputButton
85-
testId={testId && `${testId}-toggle`}
85+
testId={
86+
testId && isPasswordVisible
87+
? `${testId}-hide-icon`
88+
: `${testId}-show-icon`
89+
}
8690
onClick={(event): void => {
8791
event.preventDefault();
8892
setIsPasswordVisible(!isPasswordVisible);

0 commit comments

Comments
 (0)