<commit_before>Then /^I should not see vacation days$/ do
  page.all(".vacation").should be_empty
end

Then /^I should see a big fat "([^"]*)" as vacation day count$/ do |count|
  page.find_by_id('count').text.should == count
end

When /^I (de-)?select vacation from "([^"]*)" to "([^"]*)"$/ do |ignored, from, to|
  (from..to).to_a.each do |id|
    page.find_by_id(id).click
  end
end

When /^I (de-)?select vacation on "([^"]*)"$/ do |ignored, date|
  page.find_by_id(date).click
end

Then /^I should see vacation days from "([^"]*)" to "([^"]*)"$/ do |from, to|
  days = (from..to).to_a
  days.should have_at_least(1).item

  page.should have_selector('.vacation', :count => days.count)
  days.each do |id|
    page.find_by_id(id)['class'].split.should include('vacation')
  end
end

Then /^I should see a vacation day on "([^"]*)"$/ do |date|
  page.find_by_id(date)['class'].split.should include('vacation')
end

When /^I mark vacation days on "([^"]*)" and "([^"]*)" as half$/ do |day1, day2|
  page.find_by_id("halfdays").click
  wait_until do
    page.evaluate_script('$(":animated").length') == 0
  end
  page.find_by_id(day1).click
  page.find_by_id(day2).click
end<commit_msg>Rely on Capybara reloading by using have_selector<commit_after>Then /^I should not see vacation days$/ do
  page.all(".vacation").should be_empty
end

Then /^I should see a big fat "([^"]*)" as vacation day count$/ do |count|
  page.find_by_id('count').text.should == count
end

When /^I (de-)?select vacation from "([^"]*)" to "([^"]*)"$/ do |ignored, from, to|
  (from..to).to_a.each do |id|
    page.find_by_id(id).click
  end
end

When /^I (de-)?select vacation on "([^"]*)"$/ do |ignored, date|
  page.find_by_id(date).click
end

Then /^I should see vacation days from "([^"]*)" to "([^"]*)"$/ do |from, to|
  days = (from..to)
  days.should have_at_least(1).item

  days.each do |id|
    page.should have_selector("##{id}.vacation", count: 1)
  end
end

Then /^I should see a vacation day on "([^"]*)"$/ do |date|
  page.should have_selector("##{date}.vacation", count: 1)
end

When /^I mark vacation days on "([^"]*)" and "([^"]*)" as half$/ do |day1, day2|
  page.find_by_id("halfdays").click
  wait_until do
    page.evaluate_script('$(":animated").length') == 0
  end
  page.find_by_id(day1).click
  page.find_by_id(day2).click
end
{'fraction_non_alphanumeric': 0.20618556701030927, 'fraction_numerical': 0.006013745704467354, 'mean_word_length': 4.107456140350878, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4812933', 'n_tokens_mistral': 930, 'n_tokens_neox': 878, 'n_words': 231}