From e25693a649a5d63bd99ac128432ac8123736a841 Mon Sep 17 00:00:00 2001 From: elviabth Date: Fri, 24 May 2024 13:19:18 +0200 Subject: [PATCH] create mobile_header_spec file --- .../spec/system/mobile_header_spec.rb | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 decidim-core/spec/system/mobile_header_spec.rb diff --git a/decidim-core/spec/system/mobile_header_spec.rb b/decidim-core/spec/system/mobile_header_spec.rb new file mode 100644 index 0000000000000..7432710203fc7 --- /dev/null +++ b/decidim-core/spec/system/mobile_header_spec.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +require "spec_helper" + +describe "Mobile header" do + let(:organization) { create(:organization) } + let!(:user) { create(:user, :admin, :confirmed, organization:) } + + before do + Capybara.current_driver = :iphone + switch_to_host(organization.host) + visit decidim.root_path + click_button "Accept all" + end + + it "has a login link" do + expect(page).to have_css(".main-bar__links-mobile__login") + end + + context "when user login is confirmed" do + before do + switch_to_host(organization.host) + login_as user, scope: :user + visit decidim.root_path + end + + it "displays an avatar on the header" do + expect(page).to have_css(".main-bar__avatar") + end + end +end