qunit-dom icon indicating copy to clipboard operation
qunit-dom copied to clipboard

`hasAria('disabled')` throws an error

Open Turbo87 opened this issue 5 years ago • 3 comments

hasAria() currently delegates to hasAttribute(), but the arguments.length check in hasAttribute() does not work correctly, which makes hasAria('disabled') crash.

Turbo87 avatar Dec 04 '20 12:12 Turbo87

Also, considering that isChecked() & isNotChecked() state the following:

This also supports aria-checked="true/false".

Would it make sense to extend isDisabled() & isNotDisabled() with support for aria-disabled="true/false"?

As "just" applying aria-disabled="true/false" has no real effect without the accompanying JS / CSS — clicking an <input type="checkbox" aria-disabled="true/false"> toggles just fine — I would understand, if this addition is not desirable.

buschtoens avatar Jun 25 '21 08:06 buschtoens

good question... I guess right now we're a bit inconsistent in that regard 😞

what I'm wondering is if we should have something like .isChecked({ withAriaSupport: true | false }) and then potentially also a global setting like setup(QUnit.assert, { withAriaSupport: true | false }) 🤔

Turbo87 avatar Jun 25 '21 08:06 Turbo87

I've started #1194, which adds the withAriaSupport option.

buschtoens avatar Jul 29 '21 06:07 buschtoens