<commit_before>(function() {
	var $enlarge;

	QUnit.module("markup");

	QUnit.test("must have an anchor", function(assert){
		assert.throws(function(){
			$(".no-anchor-enlarge").enlarge();
		});
	});

	QUnit.test("must have an container", function(assert){
		assert.throws(function(){
			$(".no-contain-enlarge").enlarge();
		});
	});

	QUnit.module("exposed methods", {
		before: function(){
			$enlarge = $(".enlarge").enlarge();
		}
	});

	QUnit.test("isZoomed", function(assert){
		assert.equal($enlarge.enlarge("isZoomed"), false);
		$enlarge.enlarge("in");
		assert.equal($enlarge.enlarge("isZoomed"), true);
		$enlarge.enlarge("out");
		assert.equal($enlarge.enlarge("isZoomed"), false);
	});

	QUnit.test("in/out", function(assert){
		var done = assert.async();

		var $img = $enlarge.find( "img" );

		$enlarge.enlarge( "in" );

		// TODO events
		setTimeout(function(){
			assert.ok($img.attr("src").indexOf("large-zoomed.jpg") >=0);
			$enlarge.enlarge( "out" );
			setTimeout(function(){
				assert.ok($img.attr("src").indexOf("large-zoomed.jpg") >=0);
				done();
			},00);
		},500);
	});

	QUnit.test("updateOptions", function(assert){
		assert.equal($enlarge.enlarge("isZoomed"), false);
		$enlarge.enlarge("updateOptions", {disabled: true});
		$enlarge.enlarge("in");
		assert.equal($enlarge.enlarge("isZoomed"), false);
		$enlarge.enlarge("updateOptions", {disabled: false});
		$enlarge.enlarge("in");
		assert.equal($enlarge.enlarge("isZoomed"), true);
	});

	QUnit.module("internal methods", {
		before: function(){
			$enlarge = $(".enlarge").enlarge();
		}
	});

	QUnit.test("toggleImgZoom", function(assert){
		var done = assert.async();

		var $img = $enlarge.find("img");

		$enlarge.one("enlarge.after-zoom-in", function(){
			assert.ok($enlarge.is(".enlarge-zoomed"));
			assert.equal($enlarge.find("img").css("width"), "3000px");

			$enlarge.one("enlarge.after-zoom-out", function(){
				assert.ok(!$enlarge.is(".enlarge-zoomed"));
				$enlarge.enlarge("updateOptions", { magnification: 4 });

				$enlarge.one("enlarge.after-zoom-in", function(){
					assert.equal($enlarge.find("img").css("width"), "4000px");
					done();
				});

				$enlarge.enlarge("in");
			});

			$enlarge.enlarge("out");
		});

		$enlarge.enlarge("in");
	});
}(jQuery));<commit_msg>tracking delay test<commit_after>(function() {
	var $enlarge;

	QUnit.module("markup");

	QUnit.test("must have an anchor", function(assert){
		assert.throws(function(){
			$(".no-anchor-enlarge").enlarge();
		});
	});

	QUnit.test("must have an container", function(assert){
		assert.throws(function(){
			$(".no-contain-enlarge").enlarge();
		});
	});

	QUnit.module("exposed methods", {
		before: function(){
			$enlarge = $(".enlarge").enlarge();
		}
	});

	QUnit.test("isZoomed", function(assert){
		assert.equal($enlarge.enlarge("isZoomed"), false);
		$enlarge.enlarge("in");
		assert.equal($enlarge.enlarge("isZoomed"), true);
		$enlarge.enlarge("out");
		assert.equal($enlarge.enlarge("isZoomed"), false);
	});

	QUnit.test("in/out", function(assert){
		var done = assert.async();

		var $img = $enlarge.find( "img" );

		$enlarge.enlarge( "in" );

		// TODO events
		setTimeout(function(){
			assert.ok($img.attr("src").indexOf("large-zoomed.jpg") >=0);
			$enlarge.enlarge( "out" );
			setTimeout(function(){
				assert.ok($img.attr("src").indexOf("large-zoomed.jpg") >=0);
				done();
			},00);
		},500);
	});

	QUnit.test("updateOptions", function(assert){
		assert.equal($enlarge.enlarge("isZoomed"), false);
		$enlarge.enlarge("updateOptions", {disabled: true});
		$enlarge.enlarge("in");
		assert.equal($enlarge.enlarge("isZoomed"), false);
		$enlarge.enlarge("updateOptions", {disabled: false});
		$enlarge.enlarge("in");
		assert.equal($enlarge.enlarge("isZoomed"), true);
	});

	QUnit.module("internal methods/functionality", {
		beforeEach: function(){
			$enlarge = $(".enlarge").enlarge();
		}
	});

	QUnit.test("toggleImgZoom", function(assert){
		var done = assert.async();

		var $img = $enlarge.find("img");

		$enlarge.one("enlarge.after-zoom-in", function(){
			assert.ok($enlarge.is(".enlarge-zoomed"));
			assert.equal($enlarge.find("img").css("width"), "3000px");

			$enlarge.one("enlarge.after-zoom-out", function(){
				assert.ok(!$enlarge.is(".enlarge-zoomed"));
				$enlarge.enlarge("updateOptions", { magnification: 4 });

				$enlarge.one("enlarge.after-zoom-in", function(){
					assert.equal($enlarge.find("img").css("width"), "4000px");
					done();
				});

				$enlarge.enlarge("in");
			});

			$enlarge.enlarge("out");
		});

		$enlarge.enlarge("in");
	});

	QUnit.test("tracking delay", function(assert){
		var delay = 1000;
		var done = assert.async();
		$enlarge.enlarge( "updateOptions", {delay: delay});

		// delay - 100ms after triggering mouseenter, should not be zoomed
		setTimeout(function(){
			assert.ok(!$enlarge.is(".enlarge-zoomed"), "before tracking delay");
		}, delay - 100);

		// delay + 100ms after triggering mouseenter, should be zoomed
		setTimeout(function(){
			assert.ok($enlarge.is(".enlarge-zoomed"), "after tracking delay");
		}, delay + 100);

		// wait until the tracking delay zoom in fires
		$enlarge.one("enlarge.after-zoom-in", function(){
			setTimeout(done, 200);
		});

		assert.ok(!$enlarge.is(".enlarge-zoomed"), "before trigger");
		$enlarge.find("img").trigger("mouseenter");

		// immediately after triggering mouseenter, should not be zoomed
		assert.ok(!$enlarge.is(".enlarge-zoomed"), "after trigger");
	});
}(jQuery));
{'fraction_non_alphanumeric': 0.22349518094198945, 'fraction_numerical': 0.009274413529732678, 'mean_word_length': 4.617977528089888, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '2167714', 'n_tokens_mistral': 2173, 'n_tokens_neox': 1886, 'n_words': 288}