Skip to content

Commit c55470f

Browse files
authored
Merge pull request #43 from input-output-hk/feat/state-based-test-id-for-password-toggle
feat: state-based test id for password toggle
2 parents c706bb1 + 9537095 commit c55470f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

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

0 commit comments

Comments
 (0)