<commit_before>module Acceptance
  module CommentHelper
      def toggle_to_comment
        within add_evidence_form_css_selector do
          evidence_input = page.find_field 'text_input_view'
          evidence_input.trigger 'focus'

          page.find('.js-switch').set true
        end
      end

      def toggle_to_factlink
        within add_evidence_form_css_selector do
          page.find('.js-switch').set false
        end
      end

      def posting_factlink?
        find('button').has_content? 'Post Factlink'
      end

      def posting_comment?
        find('button').has_content? 'Post Comment'
      end

      def add_comment comment
        toggle_to_comment if posting_factlink? #unless posting_comment?

        within add_evidence_form_css_selector do
          comment_input = page.find_field 'add_comment'

          comment_input.trigger 'focus'<commit_msg>Safer checking for state of evidence adding<commit_after>module Acceptance
  module CommentHelper
      def toggle_to_comment
        within add_evidence_form_css_selector do
          evidence_input = page.find_field 'text_input_view'
          evidence_input.trigger 'focus'

          page.find('.js-switch').set true
        end
      end

      def toggle_to_factlink
        within add_evidence_form_css_selector do
          page.find('.js-switch').set false
        end
      end

      def posting_factlink?
        within add_evidence_form_css_selector do
          page.find('input').click
          find('button').has_content? 'Post Factlink'
        end
      end

      def posting_comment?
        within add_evidence_form_css_selector do
          page.find('input').click
          find('button').has_content? 'Post Comment'
        end
      end

      def add_comment comment
        toggle_to_comment if posting_factlink? #unless posting_comment?

        within add_evidence_form_css_selector do
          comment_input = page.find_field 'add_comment'

          comment_input.trigger 'focus'
{'fraction_non_alphanumeric': 0.06, 'fraction_numerical': 0.0, 'mean_word_length': 2.3857868020304567, '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': '6532145', 'n_tokens_mistral': 560, 'n_tokens_neox': 533, 'n_words': 125}