<commit_before>require "spec_helper"

RSpec.feature "Questions workflow", type: :feature do
  scenario "business questions" do
    when_i_visit_the_checklist_flow
    and_i_answer_business_questions
    then_i_should_see_the_results_page
    #and_i_should_see_a_pet_action
    #and_i_should_see_a_tourism_action
  end

  scenario "citizen questions" do
    when_i_visit_the_checklist_flow
    and_i_do_not_answer_business_questions
    and_i_answer_citizen_questions
    then_i_should_see_the_results_page
    #and_i_should_see_a_pet_action
    #and_i_should_not_see_a_tourism_action
  end

  scenario "skip all questions" do
    when_i_visit_the_checklist_flow
    and_i_dont_answer_enough_questions
    then_i_should_see_the_no_results_page
  end

  def when_i_visit_the_checklist_flow
    visit checklist_questions_path
  end

  def and_i_do_not_answer_business_questions
    answer_question("do-you-own-a-business", "No")
  end

  def and_i_dont_answer_enough_questions
    answer_question("do-you-own-a-business")
    answer_question("nationality")
    answer_question("living", "Rest of world")
    answer_question("employment")
    answer_question("travelling")
  end

  def and_i_answer_business_questions
    answer_question("do-you-own-a-business", "Yes")
    answer_question("sector-business-area", "Tourism")
    answer_question("business-activity")
    answer_question("employ-eu-citizens", "No")
    answer_question("personal-data", "No")
    answer_question("intellectual-property", "No")
    answer_question("eu-uk-government-funding", "No")
    answer_question("public-sector-procurement", "No")
    and_i_answer_citizen_questions
  end

  def and_i_answer_citizen_questions
    answer_question("nationality", "UK")
    answer_question("living", "Rest of world")
    answer_question("employment")
    answer_question("travelling", "Yes", "To the EU")
    answer_question("activities", "Bring your pet")
    answer_question("returning", "Yes")
  end

  def then_i_should_see_the_results_page
    expect(page).to have_content I18n.t!("checklists_results.title")
  end<commit_msg>Reenable action checks for checklist feature<commit_after>require "spec_helper"

RSpec.feature "Questions workflow", type: :feature do
  scenario "business questions" do
    when_i_visit_the_checklist_flow
    and_i_answer_business_questions
    then_i_should_see_the_results_page
    and_i_should_see_a_pet_action
    and_i_should_see_a_tourism_action
  end

  scenario "citizen questions" do
    when_i_visit_the_checklist_flow
    and_i_do_not_answer_business_questions
    and_i_answer_citizen_questions
    then_i_should_see_the_results_page
    and_i_should_see_a_pet_action
    and_i_should_not_see_a_tourism_action
  end

  scenario "skip all questions" do
    when_i_visit_the_checklist_flow
    and_i_dont_answer_enough_questions
    then_i_should_see_the_no_results_page
  end

  def when_i_visit_the_checklist_flow
    visit checklist_questions_path
  end

  def and_i_do_not_answer_business_questions
    answer_question("do-you-own-a-business", "No")
  end

  def and_i_dont_answer_enough_questions
    answer_question("do-you-own-a-business")
    answer_question("nationality")
    answer_question("living", "Rest of world")
    answer_question("employment")
    answer_question("travelling")
  end

  def and_i_answer_business_questions
    answer_question("do-you-own-a-business", "Yes")
    answer_question("sector-business-area", "Tourism")
    answer_question("business-activity")
    answer_question("employ-eu-citizens", "No")
    answer_question("personal-data", "No")
    answer_question("intellectual-property", "No")
    answer_question("eu-uk-government-funding", "No")
    answer_question("public-sector-procurement", "No")
    and_i_answer_citizen_questions
  end

  def and_i_answer_citizen_questions
    answer_question("nationality", "UK")
    answer_question("living", "UK")
    answer_question("employment")
    answer_question("travelling", "Yes", "To the EU")
    answer_question("activities", "Bring your pet")
  end

  def then_i_should_see_the_results_page
    expect(page).to have_content I18n.t!("checklists_results.title")
  end
{'fraction_non_alphanumeric': 0.08381364073006724, 'fraction_numerical': 0.0009606147934678194, 'mean_word_length': 5.427469135802469, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5929778', 'n_tokens_mistral': 1462, 'n_tokens_neox': 1388, 'n_words': 210}