Merge pull request #8492 from shveikus/8479-tab-behaviour-for-login-modal

Update TAB behavior for the login modal
This commit is contained in:
jibees
2021-11-25 13:42:25 +01:00
committed by GitHub
3 changed files with 17 additions and 3 deletions

View File

@@ -14,7 +14,7 @@
%input.title.input-text{name: "email",
type: "email",
id: "email",
tabindex: 1,
tabindex: "1",
inputmode: "email",
"ng-model" => "spree_user.email"}
.row
@@ -24,7 +24,7 @@
type: "password",
id: "password",
autocomplete: "off",
tabindex: 2,
tabindex: "2",
inputmode: "password",
"ng-model" => "spree_user.password"}
.row
@@ -33,12 +33,13 @@
type: "checkbox",
id: "remember_me",
value: "1",
tabindex: "3",
"ng-model" => "spree_user.remember_me"}
%label{for: "remember_me"} {{'remember_me' | t}}
.row
.large-12.columns
%input.button.primary{name: "commit",
tabindex: "3",
tabindex: "4",
type: "submit",
value: "{{'label_login' | t}}"}
:javascript

View File

@@ -109,4 +109,10 @@ module UIComponentHelper
expand_active_table_node(name)
page.find(".active_table_node a", text: name.to_s).click
end
def fill_in_using_keyboard
page.find('#email').send_keys(user.email, :tab, user.password, :tab, :space)
expect(page.find('#remember_me')).to be_checked
page.find('#remember_me').send_keys(:tab, :enter)
end
end

View File

@@ -48,6 +48,13 @@ describe "Authentication", js: true do
expect(page).to be_logged_in_as user
end
context "using keyboard" do
it "logging in successfully" do
fill_in_using_keyboard
expect(page).to be_logged_in_as user
end
end
describe "signing up" do
before do
select_login_tab "Sign up"