Skip to content

bip_text Test Helper datapicker MiniTest failure #615

@sean-whiley

Description

@sean-whiley

When using the bip_text Test Helper with a Capybara, MiniTest test, the test would fail because the date would fail its assertion of a specific entered date.

This was caused by the datepicker reseting itself when the test moved onto the next text entry point.

Adding a new method solved this problem:

def bip_date(model, attr, new_value)
  id = BestInPlace::Utils.build_best_in_place_id model, attr
  find("##{id}").click
  execute_script <<-JS
    $("##{id} input[name='#{attr}']").
      datepicker("setDate", '#{escape_javascript new_value.to_s}').
      datepicker("hide");
  JS
  wait_for_ajax
end

I tried to create a fork and make the changes but could not get the appraisal tests to run.

So if anyone is looking for a fix this might help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions