summaryrefslogtreecommitdiff
path: root/spec/support/helpers/board_helpers.rb
blob: 683ee3e4bf2b099c0ae53550b5d8511fe7f32bcd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# frozen_string_literal: true

module BoardHelpers
  def click_card(card)
    within card do
      first('.board-card-number').click
    end

    wait_for_sidebar
  end

  def wait_for_sidebar
    # loop until the CSS transition is complete
    Timeout.timeout(0.5) do
      loop until evaluate_script('$(".right-sidebar").outerWidth()') == 290
    end
  end
end