<commit_before>module Screenshots
  module DiscussionHelper

    include Acceptance::FactHelper
    include Acceptance::CommentHelper

    def create_discussion
      factlink = backend_create_fact_with_long_text
      comment_text = '1. Comment'

      sub_comment_text = "\n\nThis is a subcomment\n\nwith some  whitespace \n\n"
      sub_comment_text_normalized = "This is a subcomment with some whitespace"

      supporting_factlink = backend_create_fact_with_long_text
      go_to_discussion_page_of supporting_factlink
      click_wheel_part 0

      go_to_discussion_page_of factlink
      click_wheel_part 0

      add_comment :believes, comment_text
      add_existing_factlink :believes, supporting_factlink

      # make sure sorting is done:
      sleep 1

      vote_comment :down, comment_text

      within('.evidence-votable', text: comment_text, visible: false) do
        find('a', text: 'Comment').click
        add_sub_comment(sub_comment_text)
        assert_sub_comment_exists sub_comment_text_normalized
      end

      within('.evidence-votable', text: supporting_factlink.data.displaystring, visible: false) do
        find('.js-down').click
        eventually_succeeds do
          find('a', text: 'Comment').click
          find('.spec-sub-comments-form').should_not eq nil
        end
        add_sub_comment(sub_comment_text)
        assert_sub_comment_exists sub_comment_text_normalized
      end

      factlink<commit_msg>Removed unneeded sleep<commit_after>module Screenshots
  module DiscussionHelper

    include Acceptance::FactHelper
    include Acceptance::CommentHelper

    def create_discussion
      factlink = backend_create_fact_with_long_text
      comment_text = '1. Comment'

      sub_comment_text = "\n\nThis is a subcomment\n\nwith some  whitespace \n\n"
      sub_comment_text_normalized = "This is a subcomment with some whitespace"

      supporting_factlink = backend_create_fact_with_long_text
      go_to_discussion_page_of supporting_factlink
      click_wheel_part 0

      go_to_discussion_page_of factlink
      click_wheel_part 0

      add_comment :believes, comment_text
      add_existing_factlink :believes, supporting_factlink

      vote_comment :down, comment_text

      within('.evidence-votable', text: comment_text, visible: false) do
        find('a', text: 'Comment').click
        add_sub_comment(sub_comment_text)
        assert_sub_comment_exists sub_comment_text_normalized
      end

      within('.evidence-votable', text: supporting_factlink.data.displaystring, visible: false) do
        find('.js-down').click
        eventually_succeeds do
          find('a', text: 'Comment').click
          find('.spec-sub-comments-form').should_not eq nil
        end
        add_sub_comment(sub_comment_text)
        assert_sub_comment_exists sub_comment_text_normalized
      end

      factlink
{'fraction_non_alphanumeric': 0.06413384454513768, 'fraction_numerical': 0.0024398745207389336, 'mean_word_length': 3.2964071856287425, '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': '1370837', 'n_tokens_mistral': 868, 'n_tokens_neox': 825, 'n_words': 176}