Sha256: 9d8611ccf70eaa57aa4d429f356e3a41e7ebfaa46ce78df211fe9b96d1dcd5cd

Contents?: true

Size: 1.07 KB

Versions: 2

Compression:

Stored size: 1.07 KB

Contents

# frozen_string_literal: true

module Capybara
  module ActiveAdmin
    module Finders
      # Finders for common Active Admin components.
      module Layout
        def find_footer(options = {})
          selector = footer_selector
          have_selector(selector, options)
        end

        def within_tab_body
          selector = tab_content_selector
          within(selector) { yield }
        end

        def within_sidebar(title, exact: nil)
          selector = sidebar_selector

          within(selector) do
            within_panel(title, exact: exact) { yield }
          end
        end

        def within_panel(title, exact: nil)
          title_selector = "#{panel_selector} > #{panel_title_selector}"
          title_opts = Util.options_with_text(title, exact: exact)
          panel_title = find(title_selector, title_opts)
          panel_content = panel_title.sibling(panel_content_selector)

          within(panel_content) { yield }
        end

        def within_modal_dialog
          within(modal_dialog_selector) { yield }
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
capybara_active_admin-0.3.3 lib/capybara/active_admin/finders/layout.rb
capybara_active_admin-0.3.2 lib/capybara/active_admin/finders/layout.rb