Skip to content

Commit

Permalink
create mobile_header_spec file
Browse files Browse the repository at this point in the history
  • Loading branch information
ElviaBth committed May 24, 2024
1 parent 246f4f7 commit e25693a
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions decidim-core/spec/system/mobile_header_spec.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit e25693a

Please sign in to comment.