Skip to content

Commit

Permalink
Simplify login text
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaw3d committed May 3, 2024
1 parent ab5675f commit 02bcc6f
Show file tree
Hide file tree
Showing 14 changed files with 34 additions and 33 deletions.
1 change: 1 addition & 0 deletions .changelog/1912.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Simplify login text
2 changes: 1 addition & 1 deletion playwright/tests/migrating-persisted-state.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test.describe('Migrating persisted state', () => {
test('Decrypting V1 state should result in valid RootState', async ({ context, page }) => {
await addPersistedStorageV1(page, '/app.webmanifest')
await page.goto('/')
await page.getByPlaceholder('Enter your password here').fill(password)
await page.getByPlaceholder('Enter your password', { exact: true }).fill(password)
await page.keyboard.press('Enter')

const tab2 = await context.newPage()
Expand Down
2 changes: 1 addition & 1 deletion playwright/tests/migrating-v0-ext-persisted-state.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ test('Migrate from V0 extension persisted state to valid RootState', async ({
await test.step('start migration', async () => {
await addPersistedStorageV0(page, extensionManifestURL)
await page.goto(`${extensionPopupURL}/`)
await page.getByPlaceholder('Enter your password here').fill(password)
await page.getByPlaceholder('Enter your password', { exact: true }).fill(password)
await page.keyboard.press('Enter')
})

Expand Down
28 changes: 14 additions & 14 deletions playwright/tests/persist.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ test.describe('Persist', () => {
})
await test.step('Expect password must be chosen', async () => {
await expect(page).not.toHaveURL(new RegExp(`/account/${mnemonicAddress0}`))
await page.getByPlaceholder('Enter your password here').fill(password)
await page.getByPlaceholder('Enter your password', { exact: true }).fill(password)
await page.keyboard.press('Enter')
})
await test.step('Expect repeated password must match', async () => {
Expand All @@ -63,10 +63,10 @@ test.describe('Persist', () => {
await test.step('Expect correct password is required to unlock', async () => {
await page.goto('/')
await expect(page).not.toHaveURL(new RegExp(`/account/${mnemonicAddress0}`))
await page.getByPlaceholder('Enter your password here').fill(wrongPassword)
await page.getByPlaceholder('Enter your password', { exact: true }).fill(wrongPassword)
await page.keyboard.press('Enter')
await expect(page).not.toHaveURL(new RegExp(`/account/${mnemonicAddress0}`))
await page.getByPlaceholder('Enter your password here').fill(password)
await page.getByPlaceholder('Enter your password', { exact: true }).fill(password)
await page.keyboard.press('Enter')
await expect(page).toHaveURL(new RegExp(`/account/${mnemonicAddress0}`))

Expand All @@ -89,7 +89,7 @@ test.describe('Persist', () => {
})
await test.step('Expect password must be chosen', async () => {
await expect(page).not.toHaveURL(new RegExp(`/account/${privateKeyAddress}`))
await page.getByPlaceholder('Enter your password here').fill(password)
await page.getByPlaceholder('Enter your password', { exact: true }).fill(password)
await page.keyboard.press('Enter')
})
await test.step('Expect repeated password must match', async () => {
Expand All @@ -106,10 +106,10 @@ test.describe('Persist', () => {
await test.step('Expect correct password is required to unlock', async () => {
await page.goto('/')
await expect(page).not.toHaveURL(new RegExp(`/account/${privateKeyAddress}`))
await page.getByPlaceholder('Enter your password here').fill(wrongPassword)
await page.getByPlaceholder('Enter your password', { exact: true }).fill(wrongPassword)
await page.keyboard.press('Enter')
await expect(page).not.toHaveURL(new RegExp(`/account/${privateKeyAddress}`))
await page.getByPlaceholder('Enter your password here').fill(password)
await page.getByPlaceholder('Enter your password', { exact: true }).fill(password)
await page.keyboard.press('Enter')
await expect(page).toHaveURL(new RegExp(`/account/${privateKeyAddress}`))

Expand All @@ -128,7 +128,7 @@ test.describe('Persist', () => {
persistenceCheckboxDisabled: true,
})
await page.goto('/')
await page.getByPlaceholder('Enter your password here').fill(password)
await page.getByPlaceholder('Enter your password', { exact: true }).fill(password)
await page.keyboard.press('Enter')
await page.getByTestId('account-selector').click({ timeout: 15_000 })
await expect(page.getByTestId('account-choice')).toHaveCount(2)
Expand All @@ -142,14 +142,14 @@ test.describe('Persist', () => {
await addPersistedStorageV1(page, '/app.webmanifest')
await page.goto('/')
await mockApi(context, 123)
await page.getByPlaceholder('Enter your password here').fill(password)
await page.getByPlaceholder('Enter your password', { exact: true }).fill(password)
await page.keyboard.press('Enter')
await expect(page).toHaveURL(new RegExp(`/account/${privateKeyAddress}`))
await expect(page.getByTestId('account-balance-summary')).toContainText('123.0')
await expect(page.getByTestId('account-balance-summary')).toContainText('ROSE')
await page.getByRole('button', { name: /Lock profile/ }).click()
await mockApi(context, 456)
await page.getByPlaceholder('Enter your password here').fill(password)
await page.getByPlaceholder('Enter your password', { exact: true }).fill(password)
await page.keyboard.press('Enter')
await expect(page.getByTestId('account-balance-summary')).toContainText('456.0')
await expect(page.getByTestId('account-balance-summary')).toContainText('ROSE')
Expand All @@ -165,7 +165,7 @@ test.describe('Persist', () => {
await expect(page.getByText('One account selected')).toBeVisible({ timeout: 10_000 })

await page.getByText('Store private keys locally, protected by a password').check()
await page.getByPlaceholder('Enter your password here').fill(password)
await page.getByPlaceholder('Enter your password', { exact: true }).fill(password)
await page.keyboard.press('Enter')
await page.getByPlaceholder('Re-enter your password').fill(password)
await page.getByText('Store private keys locally, protected by a password').uncheck()
Expand All @@ -177,7 +177,7 @@ test.describe('Persist', () => {

await page.goto('/')
await expect(page.getByRole('button', { name: /^(Open wallet)|(Unlock)$/ })).toBeVisible()
await expect(page.getByPlaceholder('Enter your password here')).toBeHidden()
await expect(page.getByPlaceholder('Enter your password', { exact: true })).toBeHidden()
await expect(page.getByTestId('account-selector')).toBeHidden()
})

Expand All @@ -195,7 +195,7 @@ test.describe('Persist', () => {
persistenceCheckboxDisabled: true,
})
await page.goto('/')
await page.getByPlaceholder('Enter your password here').fill(password)
await page.getByPlaceholder('Enter your password', { exact: true }).fill(password)
await page.keyboard.press('Enter')
await page.getByTestId('account-selector').click({ timeout: 15_000 })
await expect(page.getByTestId('account-choice')).toHaveCount(1)
Expand Down Expand Up @@ -241,9 +241,9 @@ test.describe('Persist', () => {
test('Password should not be cached in input field', async ({ page }) => {
await addPersistedStorageV1(page, '/app.webmanifest')
await page.goto('/')
await page.getByPlaceholder('Enter your password here').fill(password)
await page.getByPlaceholder('Enter your password', { exact: true }).fill(password)
await page.keyboard.press('Enter')
await page.getByRole('button', { name: /Lock profile/ }).click()
await expect(page.getByPlaceholder('Enter your password here')).toHaveValue('')
await expect(page.getByPlaceholder('Enter your password', { exact: true })).toHaveValue('')
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ test('Chromium expect mnemonic, privateKey, and password to NOT leak with preven
await page.getByRole('button', { name: 'Show password' }).nth(0).click()

await page.getByPlaceholder('Enter your private key here').fill(privateKey)
await page.getByPlaceholder('Enter your password here').fill(password)
await page.getByPlaceholder('Enter your password', { exact: true }).fill(password)
await page.getByPlaceholder('Re-enter your password').fill(password)
await page.getByRole('button', { name: /Import my wallet/ }).click()
await expect(page.getByText('Loading account')).toBeHidden()
Expand Down
2 changes: 1 addition & 1 deletion playwright/tests/preventSavingInputsToDisk/firefox.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ test('Firefox expect mnemonic, privateKey, and password to NOT leak with prevent
await tab2.getByRole('button', { name: 'Show password' }).nth(0).click()

await tab2.getByPlaceholder('Enter your private key here').fill(privateKey)
await tab2.getByPlaceholder('Enter your password here').fill(password)
await tab2.getByPlaceholder('Enter your password', { exact: true }).fill(password)
await tab2.getByPlaceholder('Re-enter your password').fill(password)
// Do not submit form.
})
Expand Down
8 changes: 4 additions & 4 deletions playwright/tests/syncTabs.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ test.describe('syncTabs', () => {
test('persisted', async ({ page, context }) => {
await addPersistedStorageV1(page, '/app.webmanifest')
await page.goto('/')
await page.getByPlaceholder('Enter your password here').fill(password)
await page.getByPlaceholder('Enter your password', { exact: true }).fill(password)
await page.keyboard.press('Enter')
const tab2 = await context.newPage()
await testSyncingNetwork(page, tab2)
Expand Down Expand Up @@ -146,7 +146,7 @@ test.describe('syncTabs', () => {
test('persisted', async ({ page, context }) => {
await addPersistedStorageV1(page, '/app.webmanifest')
await page.goto('/')
await page.getByPlaceholder('Enter your password here').fill(password)
await page.getByPlaceholder('Enter your password', { exact: true }).fill(password)
await page.keyboard.press('Enter')
const tab2 = await context.newPage()
await testSyncingContacts(page, tab2)
Expand Down Expand Up @@ -210,7 +210,7 @@ test.describe('syncTabs', () => {
test('persisted', async ({ page, context }) => {
await addPersistedStorageV1(page, '/app.webmanifest')
await page.goto('/')
await page.getByPlaceholder('Enter your password here').fill(password)
await page.getByPlaceholder('Enter your password', { exact: true }).fill(password)
await page.keyboard.press('Enter')
const tab2 = await context.newPage()
await testSelectedAccountNotSync(page, tab2)
Expand Down Expand Up @@ -302,7 +302,7 @@ test.describe('syncTabs', () => {
}) => {
await addPersistedStorageV1(page, '/app.webmanifest')
await page.goto('/')
await page.getByPlaceholder('Enter your password here').fill(password)
await page.getByPlaceholder('Enter your password', { exact: true }).fill(password)
await page.keyboard.press('Enter')
await page.getByRole('link', { name: /Home/ }).click()
await page.getByRole('button', { name: /Open wallet/ }).click()
Expand Down
4 changes: 2 additions & 2 deletions playwright/tests/toolbar.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ test.describe('Profile tab', () => {
await page.getByTestId('close-settings-modal').click()
await expect(page.getByTestId('close-settings-modal')).not.toBeVisible()
await page.getByRole('button', { name: /Lock profile/ }).click()
await page.getByPlaceholder('Enter your password here').fill(tempPassword)
await page.getByPlaceholder('Enter your password', { exact: true }).fill(tempPassword)
await page.getByRole('button', { name: /Unlock/ }).click()
await expect(page.getByText('Loading', { exact: true })).toBeVisible()
await expect(page.getByText('Loading', { exact: true })).toBeHidden()
Expand All @@ -66,7 +66,7 @@ test.describe('Profile tab', () => {
await page.getByTestId('close-settings-modal').click()
await expect(page.getByTestId('close-settings-modal')).not.toBeVisible()
await page.getByRole('button', { name: /Lock profile/ }).click()
await page.getByPlaceholder('Enter your password here').fill(password)
await page.getByPlaceholder('Enter your password', { exact: true }).fill(password)
await page.getByRole('button', { name: /Unlock/ }).click()
await expect(page.getByText('Loading', { exact: true })).toBeVisible()
await expect(page.getByText('Loading', { exact: true })).toBeHidden()
Expand Down
2 changes: 1 addition & 1 deletion playwright/utils/fillPrivateKey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export async function fillPrivateKeyAndPassword(
await persistence.check()

await page.getByPlaceholder('Enter your private key here').fill(params.privateKey ?? privateKey)
await page.getByPlaceholder('Enter your password here').fill(password)
await page.getByPlaceholder('Enter your password', { exact: true }).fill(password)
await page.getByPlaceholder('Re-enter your password').fill(password)
await page.keyboard.press('Enter')
await expect(page).toHaveURL(new RegExp(`/account/${params.privateKeyAddress ?? privateKeyAddress}`))
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/Persist/ChoosePasswordFields.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export function ChoosePasswordFields() {
</label>
</Paragraph>
<ChoosePasswordInputFields
password1Placeholder={t('persist.loginToProfile.enterPasswordHere', 'Enter your password here')}
password1Placeholder={t('persist.loginToProfile.enterPasswordHere', 'Enter your password')}
password2Placeholder={t('persist.createProfile.repeatPassword', 'Re-enter your password')}
/>
</>
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/Persist/ChoosePasswordInputFields.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function ChoosePasswordInputFields({
inputElementId="password1"
name="password1"
validate={value =>
value ? undefined : t('persist.loginToProfile.enterPasswordHere', 'Enter your password here')
value ? undefined : t('persist.loginToProfile.enterPasswordHere', 'Enter your password')
}
required
showTip={t('persist.loginToProfile.showPassword', 'Show password')}
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/Persist/MigrateV0StateForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,13 @@ export function MigrateV0StateForm() {
<label htmlFor="password">
{t(
'persist.loginToProfile.description',
'Log into your existing user profile on this computer to access the wallets you already added.',
'Enter your password to access your existing wallets on this device.',
)}
</label>
</Paragraph>

<PasswordField
placeholder={t('persist.loginToProfile.enterPasswordHere', 'Enter your password here')}
placeholder={t('persist.loginToProfile.enterPasswordHere', 'Enter your password')}
name="password"
inputElementId="password"
autoFocus
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/Persist/UnlockForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ export function UnlockForm() {
<label htmlFor="password">
{t(
'persist.loginToProfile.description',
'Log into your existing user profile on this computer to access the wallets you already added.',
'Enter your password to access your existing wallets on this device.',
)}
</label>
</Paragraph>

<PasswordField
placeholder={t('persist.loginToProfile.enterPasswordHere', 'Enter your password here')}
placeholder={t('persist.loginToProfile.enterPasswordHere', 'Enter your password')}
name="password"
inputElementId="password"
autoFocus
Expand Down
4 changes: 2 additions & 2 deletions src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,8 @@
"forgotPasswordDescription": "ROSE Wallet does not store your password and cannot help you retrieve it. If you forgot your password, you can delete your locked profile here. After that, you can create a new one using your mnemonic phrase or private keys, and use your ROSE tokens again.",
"title": "Delete Profile"
},
"description": "Log into your existing user profile on this computer to access the wallets you already added.",
"enterPasswordHere": "Enter your password here",
"description": "Enter your password to access your existing wallets on this device.",
"enterPasswordHere": "Enter your password",
"hidePassword": "Hide password",
"showPassword": "Show password",
"skipUnlocking": "Continue without the profile",
Expand Down

0 comments on commit 02bcc6f

Please sign in to comment.