<commit_before>describe('aria-required-children', function () {
	'use strict';

	var fixture = document.getElementById('fixture');
	var shadowSupported = axe.testUtils.shadowSupport.v1;

	var checkContext = {
		_data: null,
		data: function (d) {
			this._data = d;
		}
	};

	function checkSetup (html, options, target) {
		fixture.innerHTML = html;
		axe._tree = axe.utils.getFlattenedTree(fixture);
		var node = fixture.querySelector(target || '#target');
		var virtualNode = axe.utils.getNodeFromTree(axe._tree[0], node);
		return [node, options, virtualNode];
	}

	afterEach(function () {
		fixture.innerHTML = '';
		axe._tree = undefined;
		checkContext._data = null;
	});

	it('should detect missing sole required child', function () {
		var params = checkSetup('<div role="list" id="target"><p>Nothing here.</p></div>');

		assert.isFalse(checks['aria-required-children'].evaluate.apply(checkContext, params));
		assert.deepEqual(checkContext._data, ['listitem']);
	});

	(shadowSupported ? it : xit)
	('should detect missing sole required child in shadow tree', function () {
		fixture.innerHTML = '<div id="target" role="list"></div>';

		var target = document.querySelector('#target');
		var shadowRoot = target.attachShadow({ mode: 'open' });
		shadowRoot.innerHTML = '<p>Nothing here.</p>';<commit_msg>test: use abstracted checkSetup from testutils<commit_after>describe('aria-required-children', function () {
	'use strict';

	var fixture = document.getElementById('fixture');
	var shadowSupported = axe.testUtils.shadowSupport.v1;

	var checkContext = {
		_data: null,
		data: function (d) {
			this._data = d;
		}
	};

	var checkSetup = axe.testUtils.checkSetup;

	afterEach(function () {
		fixture.innerHTML = '';
		axe._tree = undefined;
		checkContext._data = null;
	});

	it('should detect missing sole required child', function () {
		var params = checkSetup('<div role="list" id="target"><p>Nothing here.</p></div>');

		assert.isFalse(checks['aria-required-children'].evaluate.apply(checkContext, params));
		assert.deepEqual(checkContext._data, ['listitem']);
	});

	(shadowSupported ? it : xit)
	('should detect missing sole required child in shadow tree', function () {
		fixture.innerHTML = '<div id="target" role="list"></div>';

		var target = document.querySelector('#target');
		var shadowRoot = target.attachShadow({ mode: 'open' });
		shadowRoot.innerHTML = '<p>Nothing here.</p>';
{'fraction_non_alphanumeric': 0.16245337753833403, 'fraction_numerical': 0.0012432656444260257, 'mean_word_length': 4.902200488997555, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '3089632', 'n_tokens_mistral': 781, 'n_tokens_neox': 722, 'n_words': 168}