Hide the suggestions when the user corrects the address

This commit is contained in:
Pierre de La Morinerie 2019-12-02 17:16:42 +01:00
parent 1d1260060e
commit fb3f82074d
2 changed files with 9 additions and 0 deletions

View file

@ -15,6 +15,8 @@ delegate('focusout', userNewEmailSelector, () => {
if (suggestion && suggestion.full) {
suggestedEmailSpan.innerHTML = suggestion.full;
show(document.querySelector(suggestionsSelector));
} else {
hide(document.querySelector(suggestionsSelector));
}
});

View file

@ -41,6 +41,13 @@ feature 'Signing up:' do
expect(page).to have_field("Email", :with => 'bidou@yahoo.rf')
expect(page).to have_selector('.suspect-email', visible: false)
end
scenario 'they can fix the typo themselves', js: true do
expect(page).to have_selector('.suspect-email', visible: true)
fill_in 'Email', with: 'bidou@yahoo.fr'
blur
expect(page).to have_selector('.suspect-email', visible: false)
end
end
scenario 'a new user cant sign-up with too short password when visiting a procedure' do