<commit_before>integration("Header (Anonymous)");

test("header", function() {
  visit("/");
  andThen(function() {
    ok(exists("header"), "is rendered");
    ok(exists(".logo-big"), "it renders the large logo by default");
    not(exists("#notifications-dropdown li"), "no notifications at first");
    not(exists('#site-map-dropdown'), "no site map by default");
    not(exists("#user-dropdown:visible"), "initially user dropdown is closed");
    not(exists("#search-dropdown:visible"), "initially search box is closed");
  });

  // Logo changing
  andThen(function() {
    controllerFor('header').set("showExtraInfo", true);
  });

  andThen(function() {
    ok(exists(".logo-small"), "it shows the small logo when `showExtraInfo` is enabled");
  });

  // Site Map
  click("#site-map");
  andThen(function() {
    ok(exists('#site-map-dropdown'), "is rendered after user opens it");
    ok(exists("#site-map-dropdown .faq-link"), "it shows the faq link");
    ok(exists("#site-map-dropdown .category-links"), "has categories correctly bound");
  });

  // Search
  click("#search-button");
  andThen(function() {
    ok(exists("#search-dropdown:visible"), "after clicking a button search box opens");
    not(exists("#search-dropdown .heading"), "initially, immediately after opening, search box is empty");
  });

  // Perform Search
  fillIn("#search-term", "hello");
  andThen(function() {
    ok(exists("#search-dropdown .heading"), "when user completes a search, search box shows search results");
    equal(find("#search-dropdown a:first").attr("href"), "some-url", "there is a search result");
  });
});
<commit_msg>Correct Perform Search Test<commit_after>integration("Header (Anonymous)");

test("header", function() {
  visit("/");
  andThen(function() {
    ok(exists("header"), "is rendered");
    ok(exists(".logo-big"), "it renders the large logo by default");
    not(exists("#notifications-dropdown li"), "no notifications at first");
    not(exists('#site-map-dropdown'), "no site map by default");
    not(exists("#user-dropdown:visible"), "initially user dropdown is closed");
    not(exists("#search-dropdown:visible"), "initially search box is closed");
  });

  // Logo changing
  andThen(function() {
    controllerFor('header').set("showExtraInfo", true);
  });

  andThen(function() {
    ok(exists(".logo-small"), "it shows the small logo when `showExtraInfo` is enabled");
  });

  // Site Map
  click("#site-map");
  andThen(function() {
    ok(exists('#site-map-dropdown'), "is rendered after user opens it");
    ok(exists("#site-map-dropdown .faq-link"), "it shows the faq link");
    ok(exists("#site-map-dropdown .category-links"), "has categories correctly bound");
  });

  // Search
  click("#search-button");
  andThen(function() {
    ok(exists("#search-dropdown:visible"), "after clicking a button search box opens");
    not(exists("#search-dropdown .heading"), "initially, immediately after opening, search box is empty");
  });

  // Perform Search
  fillIn("#search-term", "hello");
  andThen(function() {
    ok(exists("#search-dropdown .heading"), "when user completes a search, search box shows search results");
    equal(find("#search-dropdown a:not(.filter):first").attr("href"), "some-url", "there is a search result");
  });
});

{'fraction_non_alphanumeric': 0.1867964709461515, 'fraction_numerical': 0.0, 'mean_word_length': 4.601362862010221, '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': '253976', 'n_tokens_mistral': 955, 'n_tokens_neox': 932, 'n_words': 257}