From c7c82c467f44eb3ec9379e900762af991b59d71a Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Mon, 23 Mar 2026 12:04:48 +1100 Subject: [PATCH] fix: add test to validate that passwords are not trimmed --- tests/automation/password.spec.ts | 56 +++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/tests/automation/password.spec.ts b/tests/automation/password.spec.ts index 47636bd..a219c52 100644 --- a/tests/automation/password.spec.ts +++ b/tests/automation/password.spec.ts @@ -13,6 +13,10 @@ import { } from './utilities/utils'; const testPassword = '123456'; +/** + * A password with spaces around. We don't trim anymore the passwords. So if the user enters a password with spaces around the text, so be it. + */ +const testPasswordSpace = ' 123456 '; const newTestPassword = '789101112'; async function expectRecoveryPhraseToBeVisible( @@ -183,3 +187,55 @@ test_Alice_1W_no_network( ); }, ); + +test_Alice_1W_no_network( + 'Do not trim spaces from password', + async ({ alice, aliceWindow1 }) => { + // Click on settings tab + await clickOn(aliceWindow1, LeftPane.settingsButton); + // Click on privacy + await clickOn(aliceWindow1, Settings.privacyMenuItem); + // Click set password + await clickOn(aliceWindow1, Settings.setPasswordSettingsButton); + // Enter password + await pasteIntoInput( + aliceWindow1, + Settings.passwordInput.selector, + testPasswordSpace, + ); + // Confirm password + await pasteIntoInput( + aliceWindow1, + Settings.confirmPasswordInput.selector, + testPasswordSpace, + ); + await clickOn(aliceWindow1, Settings.setPasswordButton); + // Check toast notification + await waitForTestIdWithText( + aliceWindow1, + Global.toast.selector, + tStripped('passwordSetDescriptionToast'), + ); + // Click on settings tab + await sleepFor(300, true); + await clickOn(aliceWindow1, Global.modalCloseButton); + await clickOn(aliceWindow1, LeftPane.settingsButton); + await clickOn(aliceWindow1, Settings.recoveryPasswordMenuItem); + await sleepFor(300, true); + + // Type password into input field and validate it + await pasteIntoInput( + aliceWindow1, + Settings.passwordInput.selector, + testPasswordSpace, + ); + // Click Done + await clickOnMatchingText(aliceWindow1, tStripped('enter')); + + // check that the seed is visible now + await expectRecoveryPhraseToBeVisible(aliceWindow1, alice.recoveryPassword); + await clickOn(aliceWindow1, Global.modalCloseButton); + await clickOn(aliceWindow1, LeftPane.settingsButton); + await clickOn(aliceWindow1, Settings.privacyMenuItem); + }, +);