<commit_before>defmodule CoursePlanner.SummaryHelperTest do
  use CoursePlanner.ModelCase

  import CoursePlanner.Factory
  alias CoursePlanner.SummaryHelper

  @empty_summary_helper_user_data_response %{terms: [], offered_courses: []}

  test "when user role is unknown" do
    student = insert(:student)
    [term1, term2] = insert_list(2, :term)
    insert_list(4, :offered_course, term: term1)
    insert(:offered_course, term: term2, students: [student])

    student_data = SummaryHelper.get_term_offered_course_for_user(%{student | role: "Unknown"})
    assert student_data == @empty_summary_helper_user_data_response
  end

  describe "Student summary data" do
    test "when she does not exist" do
      student = build(:student, id: -1, role: "Students")<commit_msg>removes the extra given role<commit_after>defmodule CoursePlanner.SummaryHelperTest do
  use CoursePlanner.ModelCase

  import CoursePlanner.Factory
  alias CoursePlanner.SummaryHelper

  @empty_summary_helper_user_data_response %{terms: [], offered_courses: []}

  test "when user role is unknown" do
    student = insert(:student)
    [term1, term2] = insert_list(2, :term)
    insert_list(4, :offered_course, term: term1)
    insert(:offered_course, term: term2, students: [student])

    student_data = SummaryHelper.get_term_offered_course_for_user(%{student | role: "Unknown"})
    assert student_data == @empty_summary_helper_user_data_response
  end

  describe "Student summary data" do
    test "when she does not exist" do
      student = build(:student, id: -1)
{'fraction_non_alphanumeric': 0.09554551323434474, 'fraction_numerical': 0.009038089089735314, 'mean_word_length': 5.078431372549019, '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': '1348415', 'n_tokens_mistral': 488, 'n_tokens_neox': 470, 'n_words': 121}