Adds login modal test case from #8861

This commit is contained in:
filipefurtad0
2022-02-11 11:04:36 +00:00
parent 27bc5805ae
commit 1113aefe11
2 changed files with 20 additions and 1 deletions

View File

@@ -156,6 +156,25 @@ describe "Authentication", js: true do
end
end
describe "Logging in from the private shop page" do
let(:distributor) { create(:distributor_enterprise, require_login: true) }
let!(:order_cycle) {
create(:simple_order_cycle, distributors: [distributor],
coordinator: create(:distributor_enterprise))
}
before do
visit enterprise_shop_path(distributor)
end
it "clicking login triggers the login modal" do
within "#shop-tabs" do
find("a", text: "login").click
end
expect(page).to have_selector("a.active", text: "Login")
expect(page).to have_button("Login")
end
end
describe "after following email confirmation link" do
it "shows confirmed message in modal" do
visit root_path(anchor: "/login", validation: "confirmed")

View File

@@ -543,7 +543,7 @@ describe "As a consumer I want to shop with a distributor", js: true do
it "tells us to login" do
visit shop_path
expect(page).to have_content "Only approved customers can access this shop."
expect(page).to have_content "login or signup"
expect(page).to have_content "login to proceed"
expect(page).to have_no_content product.name
expect(page).not_to have_selector "ordercycle"
end