diff --git a/tests/integration/components/power-select/a11y-test.js b/tests/integration/components/power-select/a11y-test.js index 0f75cd4cd..bf1cb3fab 100644 --- a/tests/integration/components/power-select/a11y-test.js +++ b/tests/integration/components/power-select/a11y-test.js @@ -82,7 +82,7 @@ module('Integration | Component | Ember Power Select (Accessibility)', function( `); await clickTrigger(); - assert.dom(findContains('.ember-power-select-option', 'two')).hasAttribute('aria-selected', 'true', 'the selected option has aria-selected=true'); + assert.dom(findContains('.ember-power-select-option', 'two')).hasAria('selected', 'true', 'the selected option has aria-selected=true'); assert.dom('.ember-power-select-option[aria-selected="false"]').exists({ count: numbers.length - 1 }, 'All other options have aria-selected=false'); }); @@ -98,8 +98,8 @@ module('Integration | Component | Ember Power Select (Accessibility)', function( `); await clickTrigger(); - assert.dom(findContains('.ember-power-select-option', 'two')).hasAttribute('aria-selected', 'true', 'the first selected option has aria-selected=true'); - assert.dom(findContains('.ember-power-select-option', 'four')).hasAttribute('aria-selected', 'true', 'the second selected option has aria-selected=true'); + assert.dom(findContains('.ember-power-select-option', 'two')).hasAria('selected', 'true', 'the first selected option has aria-selected=true'); + assert.dom(findContains('.ember-power-select-option', 'four')).hasAria('selected', 'true', 'the second selected option has aria-selected=true'); assert.dom('.ember-power-select-option[aria-selected="false"]').exists({ count: numbers.length - 2 }, 'All other options have aria-selected=false'); }); @@ -114,11 +114,11 @@ module('Integration | Component | Ember Power Select (Accessibility)', function( `); await clickTrigger(); - assert.dom(findContains('.ember-power-select-option', 'one')).hasAttribute('aria-current', 'true', 'the highlighted option has aria-current=true'); + assert.dom(findContains('.ember-power-select-option', 'one')).hasAria('current', 'true', 'the highlighted option has aria-current=true'); assert.dom('.ember-power-select-option[aria-current="false"]').exists({ count: numbers.length - 1 }, 'All other options have aria-current=false'); await triggerKeyEvent('.ember-power-select-search-input', 'keydown', 40); - assert.dom(findContains('.ember-power-select-option', 'one')).hasAttribute('aria-current', 'false', 'the first option has now aria-current=false'); - assert.dom(findContains('.ember-power-select-option', 'two')).hasAttribute('aria-current', 'true', 'the second option has now aria-current=false'); + assert.dom(findContains('.ember-power-select-option', 'one')).hasAria('current', 'false', 'the first option has now aria-current=false'); + assert.dom(findContains('.ember-power-select-option', 'two')).hasAria('current', 'true', 'the second option has now aria-current=false'); }); test('Multiple-select: The highlighted option has `aria-current=true` and the rest `aria-current=false`', async function(assert) { @@ -132,11 +132,11 @@ module('Integration | Component | Ember Power Select (Accessibility)', function( `); await clickTrigger(); - assert.dom(findContains('.ember-power-select-option', 'one')).hasAttribute('aria-current', 'true', 'the highlighted option has aria-current=true'); + assert.dom(findContains('.ember-power-select-option', 'one')).hasAria('current', 'true', 'the highlighted option has aria-current=true'); assert.dom('.ember-power-select-option[aria-current="false"]').exists({ count: numbers.length - 1 }, 'All other options have aria-current=false'); await triggerKeyEvent('.ember-power-select-search-input', 'keydown', 40); - assert.dom(findContains('.ember-power-select-option', 'one')).hasAttribute('aria-current', 'false', 'the first option has now aria-current=false'); - assert.dom(findContains('.ember-power-select-option', 'two')).hasAttribute('aria-current', 'true', 'the second option has now aria-current=false'); + assert.dom(findContains('.ember-power-select-option', 'one')).hasAria('current', 'false', 'the first option has now aria-current=false'); + assert.dom(findContains('.ember-power-select-option', 'two')).hasAria('current', 'true', 'the second option has now aria-current=false'); }); test('Single-select: Options with a disabled field have `aria-disabled=true`', async function(assert) { @@ -205,9 +205,9 @@ module('Integration | Component | Ember Power Select (Accessibility)', function( `); - assert.dom('.ember-power-select-trigger').hasAttribute('aria-expanded', 'false', 'Not expanded'); + assert.dom('.ember-power-select-trigger').hasAria('expanded', 'false', 'Not expanded'); await clickTrigger(); - assert.dom('.ember-power-select-trigger').hasAttribute('aria-expanded', 'true', 'Expanded'); + assert.dom('.ember-power-select-trigger').hasAria('expanded', 'true', 'Expanded'); }); test('Multiple-select: The trigger attribute `aria-expanded` is true when the dropdown is opened', async function(assert) { @@ -220,9 +220,9 @@ module('Integration | Component | Ember Power Select (Accessibility)', function( `); - assert.dom('.ember-power-select-trigger').hasAttribute('aria-expanded', 'false', 'Not expanded'); + assert.dom('.ember-power-select-trigger').hasAria('expanded', 'false', 'Not expanded'); await clickTrigger(); - assert.dom('.ember-power-select-trigger').hasAttribute('aria-expanded', 'true', 'Expanded'); + assert.dom('.ember-power-select-trigger').hasAria('expanded', 'true', 'Expanded'); }); test('Single-select: The listbox has a unique id`', async function(assert) { @@ -265,7 +265,7 @@ module('Integration | Component | Ember Power Select (Accessibility)', function( await clickTrigger(); assert.dom('.ember-power-select-search-input').hasAttribute('type', 'search', 'The type of the input is `search`'); - assert.dom('.ember-power-select-search-input').hasAttribute('aria-controls', /^ember-power-select-options-ember\d+$/, 'The `aria-controls` points to the id of the listbox'); + assert.dom('.ember-power-select-search-input').hasAria('controls', /^ember-power-select-options-ember\d+$/, 'The `aria-controls` points to the id of the listbox'); }); test('Multiple-select: The searchbox has type `search` and `aria-controls=`', async function(assert) { @@ -280,7 +280,7 @@ module('Integration | Component | Ember Power Select (Accessibility)', function( await clickTrigger(); assert.dom('.ember-power-select-trigger-multiple-input').hasAttribute('type', 'search', 'The type of the input is `search`'); - assert.dom('.ember-power-select-trigger-multiple-input').hasAttribute('aria-controls', /^ember-power-select-options-ember\d+$/, 'The `aria-controls` points to the id of the listbox'); + assert.dom('.ember-power-select-trigger-multiple-input').hasAria('controls', /^ember-power-select-options-ember\d+$/, 'The `aria-controls` points to the id of the listbox'); }); test('Multiple-select: The selected elements are
  • s inside an