From 3e2c41aa720b988f7050ffbedb9e308fdf2a12f3 Mon Sep 17 00:00:00 2001 From: William B <7444334+whabanks@users.noreply.github.com> Date: Mon, 29 Jan 2024 15:38:24 -0500 Subject: [PATCH] Clarify in email hint text that shared inbox is not allowed (#1746) * Clarify in email hint text that shared inbox is not allowed - Changed the password field's validation message to clarify what a hard to guess password is - Fixed the aria-invalid attribute on text boxes - Add cypress tests for registration page - Use jsrsasign to generate JWTs for admin api access in cypress tests * Various cleanups * Remove unused import * Add missing translation * Undo unneeded changes to cypress.config.js * Clear cookies after login and register test suites * Refactor and clean up tests a bit - Pulled the wait for confirmation email code into it's own action and out of CreateAccount - Added nanoid and use it for unique aliases on the email address - Fetch the confirmation link in a more sane way * Installed nanoid in the wrong package.json... --- app/main/forms.py | 8 +- app/templates/components/textbox.html | 6 +- app/templates/views/register.html | 2 +- app/translations/csv/fr.csv | 4 +- tests/app/main/test_validators.py | 6 +- .../test_organisation_invites.py | 2 +- tests/app/main/views/test_register.py | 5 +- tests_cypress/config.js | 4 +- .../Notify/Admin/Pages/CreateAccountPage.js | 64 ++ .../cypress/Notify/Admin/Pages/all.js | 8 +- tests_cypress/cypress/Notify/NotifyAPI.js | 42 +- tests_cypress/cypress/e2e/admin/all.cy.js | 1 + tests_cypress/cypress/e2e/admin/login.cy.js | 5 + .../cypress/e2e/admin/register.cy.js | 71 +++ tests_cypress/package-lock.json | 557 ++++++++++-------- tests_cypress/package.json | 3 +- 16 files changed, 511 insertions(+), 277 deletions(-) create mode 100644 tests_cypress/cypress/Notify/Admin/Pages/CreateAccountPage.js create mode 100644 tests_cypress/cypress/e2e/admin/register.cy.js diff --git a/app/main/forms.py b/app/main/forms.py index f0717ec28b..e956882536 100644 --- a/app/main/forms.py +++ b/app/main/forms.py @@ -164,8 +164,12 @@ def password(label=_l("Password")): label, validators=[ DataRequired(message=_l("This cannot be empty")), - Length(8, 255, message=_l("Must be at least 8 characters and hard to guess")), - Blocklist(message=_l("Choose a password that’s harder to guess")), + Length(8, 255, message=_l("Must be at least 8 characters")), + Blocklist( + message=_l( + "A password that is hard to guess contains: