<commit_before>describe('focusable-no-name', function () {
	'use strict';

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

	afterEach(function () {
		fixture.innerHTML = '';
	});

	it('should pass if tabindex < 0', function () {
		fixtureSetup('<a href="#" tabindex="-1"></a>');
		var node = fixture.querySelector('a');
		assert.isFalse(checks['focusable-no-name'].evaluate(node));
	});

	it('should pass element is not natively focusable', function () {
		fixtureSetup('<span role="link" href="#"></span>');
		var node = fixture.querySelector('span');
		assert.isFalse(checks['focusable-no-name'].evaluate(node));
	});

	it('should fail if element is tabbable with no name - native', function () {
		fixtureSetup('<a href="#"></a>');
		var node = fixture.querySelector('a');
		assert.isTrue(checks['focusable-no-name'].evaluate(node));
	});

	it('should fail if element is tabbable with no name - ARIA', function () {
		fixtureSetup('<span tabindex="0" role="link" href="#"></spam>');
		var node = fixture.querySelector('span');
		assert.isTrue(checks['focusable-no-name'].evaluate(node));
	});

	it('should pass if the element is tabbable but has an accessible name', function () {
		fixtureSetup('<a href="#" title="Hello"></a>');
		var node = fixture.querySelector('a');
		assert.isFalse(checks['focusable-no-name'].evaluate(node));
	});

	(shadowSupport.v1 ? it : xit)('should pass if the content is passed in with shadow DOM', function () {
		var node = document.createElement('div');
		node.innerText = 'Content!';
		var shadow = node.attachShadow({ mode: 'open' });
		shadow.innerHTML = '<a href="#"><slot></slot></a>';
		fixtureSetup(node);

		var link = shadow.querySelector('a');
		assert.isFalse(checks['focusable-no-name'].evaluate(link));
	});

});
<commit_msg>test: More testing for accessibleText()<commit_after>describe('focusable-no-name', function () {
	'use strict';

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

	afterEach(function () {
		fixture.innerHTML = '';
	});

	it('should pass if tabindex < 0', function () {
		fixtureSetup('<a href="#" tabindex="-1"></a>');
		var node = fixture.querySelector('a');
		assert.isFalse(checks['focusable-no-name'].evaluate(node));
	});

	it('should pass element is not natively focusable', function () {
		fixtureSetup('<span role="link" href="#"></span>');
		var node = fixture.querySelector('span');
		assert.isFalse(checks['focusable-no-name'].evaluate(node));
	});

	it('should fail if element is tabbable with no name - native', function () {
		fixtureSetup('<a href="#"></a>');
		var node = fixture.querySelector('a');
		assert.isTrue(checks['focusable-no-name'].evaluate(node));
	});

	it('should fail if element is tabable with no name - ARIA', function () {
		fixtureSetup('<span tabindex="0" role="link" href="#"></spam>');
		var node = fixture.querySelector('span');
		assert.isTrue(checks['focusable-no-name'].evaluate(node));
	});

	it('should pass if the element is tabable but has an accessible name', function () {
		fixtureSetup('<a href="#" title="Hello"></a>');
		var node = fixture.querySelector('a');
		assert.isFalse(checks['focusable-no-name'].evaluate(node));
	});

	(shadowSupport.v1 ? it : xit)('should pass if the content is passed in with shadow DOM', function () {
		var node = document.createElement('div');
		node.innerText = 'Content!';
		var shadow = node.attachShadow({ mode: 'open' });
		shadow.innerHTML = '<a href="#"><slot></slot></a>';
		fixtureSetup(node);

		var link = shadow.querySelector('a');
		assert.isFalse(checks['focusable-no-name'].evaluate(link));
	});

});

{'fraction_non_alphanumeric': 0.1934886183165696, 'fraction_numerical': 0.0021175224986765486, 'mean_word_length': 5.18494271685761, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 31, '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': '6876416', 'n_tokens_mistral': 1246, 'n_tokens_neox': 1161, 'n_words': 266}