<commit_before>describe("CustomDataAttributesImpl:", function() {
	describe("setOnClick", function() {
		it("should set onClick to all html elements that have specified the necessary data attributes", function() {
			var str = '<div id="withinDiv"><div data-cda-loadOnClick="yes" data-cda-location="test.html" data-cda-location-section="#test" id="testdiv"></div>'+
					  '<a data-cda-loadOnClick="yes" data-cda-location="test2.html" data-cda-location-section="#test2" id="testa"></a>'+
					  '<button data-cda-loadOnClick="yes" data-cda-location="test3.html" data-cda-location-section="#test3" id="testbutton"></button></div>';
					  
			setFixtures(str);
			content = jasmine.createSpyObj('Content', ['loadIntoSection']);
			cda = new CustomDataAttributesImpl(content);
			cda.setOnClickEvent("#withinDiv");
			
			$("#testdiv").click();
			expect(content.loadIntoSection).toHaveBeenCalledWith("test.html", "#test");
			$("#testa").click();
			expect(content.loadIntoSection).toHaveBeenCalledWith("test2.html", "#test2");
			$("#testbutton").click();
			expect(content.loadIntoSection).toHaveBeenCalledWith("test3.html", "#test3");
		});
	});
});<commit_msg>add another unit test for customdataattributes<commit_after>describe("CustomDataAttributesImpl:", function() {
	describe("setOnClick", function() {
		it("should set onClick to all html elements that have specified the necessary data attributes", function() {
			var str = '<div id="withinDiv"><div data-cda-loadOnClick="yes" data-cda-location="test.html" data-cda-location-section="#test" id="testdiv"></div>'+
					  '<a data-cda-loadOnClick="yes" data-cda-location="test2.html" data-cda-location-section="#test2" id="testa"></a>'+
					  '<button data-cda-loadOnClick="yes" data-cda-location="test3.html" data-cda-location-section="#test3" id="testbutton"></button></div>';
					  
			setFixtures(str);
			content = jasmine.createSpyObj('Content', ['loadIntoSection']);
			cda = new CustomDataAttributesImpl(content);
			cda.setOnClickEvent("#withinDiv");
			
			$("#testdiv").click();
			expect(content.loadIntoSection).toHaveBeenCalledWith("test.html", "#test");
			$("#testa").click();
			expect(content.loadIntoSection).toHaveBeenCalledWith("test2.html", "#test2");
			$("#testbutton").click();
			expect(content.loadIntoSection).toHaveBeenCalledWith("test3.html", "#test3");
		});
		
		it("should set onClick only within specified div", function() {
			var str = '<div id="withinDiv_spec2"><div data-cda-loadOnClick="yes" data-cda-location="test.html" data-cda-location-section="#test" id="testdiv"></div></div>'+
					  '<div id="notWithinDiv_spec2"><a data-cda-loadOnClick="yes" data-cda-location="test2.html" data-cda-location-section="#test2" id="testa"></a></div>';
					  
			setFixtures(str);
			content = jasmine.createSpyObj('Content', ['loadIntoSection']);
			cda = new CustomDataAttributesImpl(content);
			cda.setOnClickEvent("#withinDiv_spec2");
			
			$("#testdiv").click();
			expect(content.loadIntoSection).toHaveBeenCalledWith("test.html", "#test");
			$("#testa").click();
			expect(content.loadIntoSection).not.toHaveBeenCalledWith("test2.html", "#test2");
		});
	});
});
{'fraction_non_alphanumeric': 0.19487503954444796, 'fraction_numerical': 0.007276178424549193, 'mean_word_length': 5.742004264392324, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, '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': '4656634', 'n_tokens_mistral': 1124, 'n_tokens_neox': 1010, 'n_words': 149}