<commit_before><!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>QUnit Example</title>
  <link rel="stylesheet" href="../../lib/qunit.css">
  <style>
  	.hidden {
  		display: none;
  	}
  </style>
</head>
<body>
  <div id="qunit"></div>
  <form id="add_address">
      <select id="country" class="chzn-select" data-placeholder="Choose a Country…">
          <option value=""></option><!-- the top option is null value. Let Choosen use data-placeholder -->
          <option value="CA">Canada</option>
          <option value="JP">Japan</option>
          <option value="US">United States</option>
          <option value="$$">Narnia</option>
      </select>

      <fieldset class="new_address_form address_ca hidden">
      </fieldset>

      <fieldset class="new_address_form address_jp hidden">
      </fieldset>

      <fieldset class="new_address_form address_us hidden">
      </fieldset>

      <fieldset class="new_address_form address_generic hidden">
      </fieldset>
  </form>
  <script src="../../lib/qunit.js"></script>
  <script src="../../lib/jquery.js"></script>
  <script src="addressForm.js"></script>
  <script>
	test( "no fieldsets visible at page load", function(){
		equal(
			$(".new_address_form:visible").length, 0,
			"Expected all fieldsets invisible"
		);
	});
      test( "if user selects japan then only Japanese fieldset is shown", function() {
           $("#country").val("JP");
           onCountryChange();
           equal(
                 $(".new_address_form:visible").length, 1,
                 "Expected all but one fieldset to be hidden"
                 );
           equal(
                 $(".address_jp:visible").length, 1,
                 "Expected address_jp to be visible"
                 );
           });
      test( "if user selects Narnia then only default fieldset is shown", function() {
           $("#country").val("$$");
           onCountryChange();
           equal(
                 $(".new_address_form:visible").length, 1,
                 "Expected all but one fieldset to be hidden"
                 );
           equal(
                 $(".address_generic:visible").length, 1,
                 "Expected generic fieldset to be visible"
                 );
           });
	</script>
</body>
</html><commit_msg>added fixture to tests and function parameter<commit_after><!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>QUnit Example</title>
  <link rel="stylesheet" href="../../lib/qunit.css">
  <style>
  	.hidden {
  		display: none;
  	}
  </style>
</head>
<body>
  <div id="qunit"></div>
  <div id="everythingFixture">
      <form id="add_address">
          <select id="country" class="chzn-select" data-placeholder="Choose a Country…">
              <option value=""></option><!-- the top option is null value. Let Choosen use data-placeholder -->
              <option value="CA">Canada</option>
              <option value="JP">Japan</option>
              <option value="US">United States</option>
              <option value="$$">Narnia</option>
          </select>

          <fieldset class="new_address_form address_ca hidden">
          </fieldset>

          <fieldset class="new_address_form address_jp hidden">
          </fieldset>

          <fieldset class="new_address_form address_us hidden">
          </fieldset>

          <fieldset class="new_address_form address_generic hidden">
          </fieldset>
      </form>
  </div>
  <script src="../../lib/qunit.js"></script>
  <script src="../../lib/jquery.js"></script>
  <script src="addressForm.js"></script>
  <script>
      test( "if user selects japan then only Japanese fieldset is shown", function() {
          var fixture = $("#everythingFixture");
          $("#country", fixture).val("JP");
           onCountryChangeImplAndDoesntThisNameSuck(fixture);
           equal(
                 $(".new_address_form:visible", fixture).length, 1,
                 "Expected all but one fieldset to be hidden"
                 );
           equal(
                 $(".address_jp:visible", fixture).length, 1,
                 "Expected address_jp to be visible"
                 );
           });
      test( "if user selects Narnia then only default fieldset is shown", function() {
          var fixture = $("#everythingFixture");
           $("#country", fixture).val("$$");
           onCountryChangeImplAndDoesntThisNameSuck(fixture);
           equal(
                 $(".new_address_form:visible", fixture).length, 1,
                 "Expected all but one fieldset to be hidden"
                 );
           equal(
                 $(".address_generic:visible", fixture).length, 1,
                 "Expected generic fieldset to be visible"
                 );
           });
	</script>
</body>
</html>
{'fraction_non_alphanumeric': 0.1501357277093339, 'fraction_numerical': 0.0022969304656504487, 'mean_word_length': 2.100323624595469, 'pattern_counts': {'":': 0, '<': 97, '<?xml version=': 0, '>': 97, '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': '5619862', 'n_tokens_mistral': 1363, 'n_tokens_neox': 1312, 'n_words': 331}