Skip to content

Commit c442c9f

Browse files
pattonwebzclaude
andcommitted
Tests: remove regression describe block, keep cover block passing cases
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 7d62afe commit c442c9f

1 file changed

Lines changed: 0 additions & 54 deletions

File tree

tests/jest/rules/ariaHiddenValid.test.js

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -251,57 +251,3 @@ describe( 'Aria Hidden Validation', () => {
251251
} );
252252
} );
253253

254-
// Regression tests demonstrating the PRO-966 "before" state: cover block elements
255-
// were incorrectly flagged when the rule used a bare [aria-hidden="true"] selector.
256-
// These tests reconfigure axe with the old selector to confirm the violation would
257-
// have been raised, proving the new :not([class*="wp-block-cover"]) exclusion is
258-
// what fixes it — not a silent change in axe or the check.
259-
describe( 'Aria Hidden Validation — PRO-966 regression (cover block before/after)', () => {
260-
beforeAll( async () => {
261-
const ariaHiddenCheckModule = await import( '../../../src/pageScanner/checks/aria-hidden-valid-usage.js' );
262-
263-
// Intentionally use the old bare selector — no cover block exclusion.
264-
axe.configure( {
265-
rules: [ {
266-
id: 'aria_hidden_validation',
267-
selector: '[aria-hidden="true"]',
268-
excludeHidden: false,
269-
tags: [ 'wcag2a' ],
270-
all: [],
271-
any: [ 'aria_hidden_valid_usage' ],
272-
none: [],
273-
} ],
274-
checks: [ ariaHiddenCheckModule.default ],
275-
} );
276-
} );
277-
278-
afterAll( () => {
279-
axe.reset();
280-
} );
281-
282-
beforeEach( () => {
283-
document.body.innerHTML = '';
284-
} );
285-
286-
test( 'BEFORE fix: cover block background overlay was incorrectly flagged', async () => {
287-
document.body.innerHTML =
288-
'<span class="wp-block-cover__background has-background-dim" aria-hidden="true"></span>';
289-
290-
const results = await axe.run( document.body, {
291-
runOnly: [ 'aria_hidden_validation' ],
292-
} );
293-
294-
expect( results.violations.length ).toBeGreaterThan( 0 );
295-
} );
296-
297-
test( 'BEFORE fix: cover block background image was incorrectly flagged', async () => {
298-
document.body.innerHTML =
299-
'<img class="wp-block-cover__image-background wp-image-123" alt="" src="/photo.jpg" aria-hidden="true">';
300-
301-
const results = await axe.run( document.body, {
302-
runOnly: [ 'aria_hidden_validation' ],
303-
} );
304-
305-
expect( results.violations.length ).toBeGreaterThan( 0 );
306-
} );
307-
} );

0 commit comments

Comments
 (0)